summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cammarata <jimi@sngx.net>2016-05-17 14:06:10 -0400
committerJames Cammarata <jimi@sngx.net>2016-05-17 15:25:52 -0400
commit887850bbc78b5ecc8d0fd907ec6d7b29c277e3c1 (patch)
tree9728390cecf91dfaa020021482a11b5ffac39650
parent4bcde6e248f2acfa18753047ec7ad305c294bc5f (diff)
downloadansible-vroy_backward-compatible-executor.tar.gz
In TQM run() mark any entries in _failed_hosts as failed in the PlayIteratorvroy_backward-compatible-executor
As noted in the comment, the TQM may be used for more than one play. As such, after creating the new PlayIterator object it is necessary to mark any failed hosts from previous calls to run() as failed in the iterator, so they are properly skipped during any future calls to run().
-rw-r--r--lib/ansible/executor/task_queue_manager.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/ansible/executor/task_queue_manager.py b/lib/ansible/executor/task_queue_manager.py
index c2592f0f34..ba4970ed66 100644
--- a/lib/ansible/executor/task_queue_manager.py
+++ b/lib/ansible/executor/task_queue_manager.py
@@ -236,6 +236,13 @@ class TaskQueueManager:
start_at_done = self._start_at_done,
)
+ # because the TQM may survive multiple play runs, we start by
+ # marking any hosts as failed in the iterator here which may
+ # have been marked as failed in previous runs.
+ for host_name in self._failed_hosts.keys():
+ host = self._inventory.get_host(host_name)
+ iterator.mark_host_failed(host)
+
# during initialization, the PlayContext will clear the start_at_task
# field to signal that a matching task was found, so check that here
# and remember it so we don't try to skip tasks on future plays