Use ansible_host in synchronize module

Fixes #13073
pull/13281/head
Joern Heissler 9 years ago committed by Toshio Kuratomi
parent f2225395f9
commit c99fffa936

@ -131,7 +131,13 @@ class ActionModule(ActionBase):
src_host = '127.0.0.1'
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)
try:
dest_host = dest_host_inventory_vars['ansible_host']
except KeyError:
try:
dest_host = dest_host_inventory_vars['ansible_ssh_host']
except KeyError:
dest_host = inventory_hostname
dest_is_local = dest_host in C.LOCALHOST

Loading…
Cancel
Save