mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
properly track delegated host in loops
ansible_host can be pulled from inventory and not match inventory_hostname, this can "loose" vars to a new host named by ansible_host vs the delegated host fixes #25770
This commit is contained in:
@@ -628,7 +628,7 @@ class TaskExecutor:
|
||||
delegated_vars = variables.get('ansible_delegated_vars', dict()).get(self._task.delegate_to, dict()).copy()
|
||||
if len(delegated_vars) > 0:
|
||||
result["_ansible_delegated_vars"] = dict()
|
||||
for k in ('ansible_host', ):
|
||||
for k in ('ansible_delegated_host', 'ansible_host' ):
|
||||
result["_ansible_delegated_vars"][k] = delegated_vars.get(k)
|
||||
|
||||
# and return
|
||||
|
||||
Reference in New Issue
Block a user