mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
fixes ansible/ansible#3609 Add max_fail_pct to playbook parameter, to complement serial option, So if total number of failures execeed max_fail_pct * total number of hosts, do not go to the next serial batch
This commit is contained in:
committed by
James Cammarata
parent
2dd3f01513
commit
3f247fcbe3
@@ -580,6 +580,10 @@ class PlayBook(object):
|
||||
if task.any_errors_fatal and len(host_list) < hosts_count:
|
||||
host_list = None
|
||||
|
||||
# If threshold for max nodes failed is exceeded , bail out.
|
||||
if (hosts_count - len(host_list)) > int((play.max_fail_pct)/100.0 * hosts_count):
|
||||
host_list = None
|
||||
|
||||
# if no hosts remain, drop out
|
||||
if not host_list:
|
||||
self.callbacks.on_no_hosts_remaining()
|
||||
|
||||
Reference in New Issue
Block a user