summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMartin Krizek <martin.krizek@gmail.com>2024-08-13 17:39:00 +0200
committerGitHub <noreply@github.com>2024-08-13 17:39:00 +0200
commit5c84220dbb6a37c94e36f36229c8dda90eadd06b (patch)
tree3f3f736325659cc97b48eca0835878f24154570b /lib
parentini lookup: add new interpolation option (#83773) (diff)
downloadansible-5c84220dbb6a37c94e36f36229c8dda90eadd06b.tar.xz
ansible-5c84220dbb6a37c94e36f36229c8dda90eadd06b.zip
Fix meta tasks breaking host/fork affinity with host_pinned (#83438)
Fixes #83294
Diffstat (limited to 'lib')
-rw-r--r--lib/ansible/plugins/strategy/free.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ansible/plugins/strategy/free.py b/lib/ansible/plugins/strategy/free.py
index 6f33a68920..04c16024d9 100644
--- a/lib/ansible/plugins/strategy/free.py
+++ b/lib/ansible/plugins/strategy/free.py
@@ -95,6 +95,7 @@ class StrategyModule(StrategyBase):
# try and find an unblocked host with a task to run
host_results = []
+ meta_task_dummy_results_count = 0
while True:
host = hosts_left[last_host]
display.debug("next free host: %s" % host)
@@ -181,6 +182,9 @@ class StrategyModule(StrategyBase):
continue
if task.action in C._ACTION_META:
+ if self._host_pinned:
+ meta_task_dummy_results_count += 1
+ workers_free -= 1
self._execute_meta(task, play_context, iterator, target_host=host)
self._blocked_hosts[host_name] = False
else:
@@ -220,7 +224,7 @@ class StrategyModule(StrategyBase):
host_results.extend(results)
# each result is counted as a worker being free again
- workers_free += len(results)
+ workers_free += len(results) + meta_task_dummy_results_count
self.update_active_connections(results)