summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cammarata <jimi@sngx.net>2016-05-12 10:38:53 -0400
committerJames Cammarata <jimi@sngx.net>2016-05-12 10:38:53 -0400
commitd391c53b4fda2995cd04890fbda8a05800f21ce4 (patch)
tree6d8f68e9d36a8ca5efd288ab2a8782a6c17ddd4c
parent08f6283c3fd136c6bba09e33ead18c8c767bc3af (diff)
downloadansible-d391c53b4fda2995cd04890fbda8a05800f21ce4.tar.gz
Clear blocked hosts when a role duplicate task is found in free strategy
In the free strategy, we mark a host as blocked when it has work to do (the PlayIterator returns a task) to prevent multiple tasks from being sent to the host. However, we check for role duplicates after setting the blocked flag, but were not clearing that when the task was skipped leading to an infinite loop. This patch corrects that by clearing the blocked flag when the task is skipped. Fixes #15681
-rw-r--r--lib/ansible/plugins/strategy/free.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ansible/plugins/strategy/free.py b/lib/ansible/plugins/strategy/free.py
index fb0ae7dfcc..ae8370d5fb 100644
--- a/lib/ansible/plugins/strategy/free.py
+++ b/lib/ansible/plugins/strategy/free.py
@@ -123,6 +123,7 @@ class StrategyModule(StrategyBase):
# if there is metadata, check to see if the allow_duplicates flag was set to true
if task._role._metadata is None or task._role._metadata and not task._role._metadata.allow_duplicates:
display.debug("'%s' skipped because role has already run" % task)
+ del self._blocked_hosts[host_name]
continue
if task.action == 'meta':