1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #13074 from joernheissler/patch-13073

Use ansible_host in synchronize module
This commit is contained in:
Toshio Kuratomi 2015-11-19 09:51:43 -08:00
commit 72558f7ecd

View file

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