mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Update synchronize to use the correct host when delegating
Fixes #12752
This commit is contained in:
parent
85abd61001
commit
5617f6aad4
1 changed files with 3 additions and 1 deletions
|
@ -125,7 +125,9 @@ class ActionModule(ActionBase):
|
||||||
# running on so localhost could be a non-controller machine if
|
# running on so localhost could be a non-controller machine if
|
||||||
# delegate_to is used)
|
# delegate_to is used)
|
||||||
src_host = '127.0.0.1'
|
src_host = '127.0.0.1'
|
||||||
dest_host = task_vars.get('ansible_ssh_host') or task_vars.get('inventory_hostname')
|
inventory_hostname = task_vars.get('inventory_hostname')
|
||||||
|
dest_host_inventory_vars = task_vars['hostvars'].get(inventory_hostname)
|
||||||
|
dest_host = dest_host_inventory_vars.get('ansible_ssh_host', inventory_hostname)
|
||||||
|
|
||||||
dest_is_local = dest_host in C.LOCALHOST
|
dest_is_local = dest_host in C.LOCALHOST
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue