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:
Kavin Kankeshwar
2013-07-23 16:03:13 -07:00
committed by James Cammarata
parent 2dd3f01513
commit 3f247fcbe3
2 changed files with 7 additions and 3 deletions

View File

@@ -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()