Update synchronize to use the correct host when delegating

Fixes #12752
This commit is contained in:
Toshio Kuratomi 2015-10-14 18:55:46 -07:00
parent 85abd61001
commit 5617f6aad4

View file

@ -125,7 +125,9 @@ class ActionModule(ActionBase):
# running on so localhost could be a non-controller machine if
# delegate_to is used)
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