diff options
author | Martin Krizek <martin.krizek@gmail.com> | 2021-10-12 18:15:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-12 18:15:37 +0200 |
commit | b1211429d5a493c55914d9a97257859fe7d1208c (patch) | |
tree | 35667ce891aae684c9c40ce1d55416e52177d9e4 /lib/ansible/plugins | |
parent | 7a28246248cdb7fdbfde281488d813c953aa8e75 (diff) | |
download | ansible-b1211429d5a493c55914d9a97257859fe7d1208c.tar.gz |
Fix executing includes in the free strategy (#75649)
Fixes #75642
Diffstat (limited to 'lib/ansible/plugins')
-rw-r--r-- | lib/ansible/plugins/strategy/free.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/ansible/plugins/strategy/free.py b/lib/ansible/plugins/strategy/free.py index 7e0406984d..326c347ad3 100644 --- a/lib/ansible/plugins/strategy/free.py +++ b/lib/ansible/plugins/strategy/free.py @@ -120,17 +120,19 @@ class StrategyModule(StrategyBase): (state, task) = iterator.get_next_task_for_host(host, peek=True) display.debug("free host state: %s" % state, host=host_name) display.debug("free host task: %s" % task, host=host_name) - if host_name not in self._tqm._unreachable_hosts and task: + # check if there is work to do, either there is a task or the host is still blocked which could + # mean that it is processing an include task and after its result is processed there might be + # more tasks to run + if (task or self._blocked_hosts.get(host_name, False)) and not self._tqm._unreachable_hosts.get(host_name, False): + display.debug("this host has work to do", host=host_name) # set the flag so the outer loop knows we've still found # some work which needs to be done work_to_do = True - display.debug("this host has work to do", host=host_name) - + if not self._tqm._unreachable_hosts.get(host_name, False) and task: # check to see if this host is blocked (still executing a previous task) - if (host_name not in self._blocked_hosts or not self._blocked_hosts[host_name]): - + if not self._blocked_hosts.get(host_name, False): display.debug("getting variables", host=host_name) task_vars = self._variable_manager.get_vars(play=iterator._play, host=host, task=task, _hosts=self._hosts_cache, |