summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Roy <vincentroy8@gmail.com>2016-04-15 22:59:54 -0300
committerJames Cammarata <jimi@sngx.net>2016-05-18 08:17:53 -0400
commitb0259a86316cc080015b366fc4f0d2047276d87a (patch)
tree7dfc3aab0eefdec7cdb655c09d62976221e4e6b9
parent5e9b13cb949cd4b347c8585bf314577028b5b3eb (diff)
downloadansible-b0259a86316cc080015b366fc4f0d2047276d87a.tar.gz
Make sure that serial failures are handled correctly.
-rw-r--r--lib/ansible/executor/playbook_executor.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ansible/executor/playbook_executor.py b/lib/ansible/executor/playbook_executor.py
index 29ac3e9b7c..041f51bf70 100644
--- a/lib/ansible/executor/playbook_executor.py
+++ b/lib/ansible/executor/playbook_executor.py
@@ -128,6 +128,7 @@ class PlaybookExecutor:
else:
self._tqm._unreachable_hosts.update(self._unreachable_hosts)
+ break_play = False
# we are actually running plays
for batch in self._get_serialized_batches(new_play):
if len(batch) == 0:
@@ -147,8 +148,10 @@ class PlaybookExecutor:
failed_hosts_count = len(self._tqm._failed_hosts) + len(self._tqm._unreachable_hosts)
if new_play.max_fail_percentage is not None and \
int((new_play.max_fail_percentage)/100.0 * len(batch)) > int((len(batch) - failed_hosts_count) / len(batch) * 100.0):
+ break_play = True
break
elif len(batch) == failed_hosts_count:
+ break_play = True
break
# save the unreachable hosts from this batch
@@ -159,6 +162,9 @@ class PlaybookExecutor:
if result not in (0, 3):
break
+ if break_play:
+ break
+
i = i + 1 # per play
if entry: