|
|
@ -65,13 +65,12 @@ class ActionModule(object):
|
|
|
|
except KeyError:
|
|
|
|
except KeyError:
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
dest_host = inject.get('delegate_to',
|
|
|
|
# the localhost is the default delegate in an rsync task
|
|
|
|
inject.get('ansible_ssh_host'))
|
|
|
|
if inject.get('delegate_to') is None:
|
|
|
|
if dest_host is None:
|
|
|
|
conn.delegate = '127.0.0.1'
|
|
|
|
dest_host = inject['inventory_hostname']
|
|
|
|
inject['delegate_to'] = '127.0.0.1'
|
|
|
|
if dest_host in ['localhost', '127.0.0.1']:
|
|
|
|
src_host = inject['delegate_to']
|
|
|
|
dest_host = '127.0.0.1'
|
|
|
|
dest_host = inject.get('ansible_ssh_host', inject['inventory_hostname'])
|
|
|
|
src_host = '127.0.0.1' # inventory_hostname is localhost when transport not local
|
|
|
|
|
|
|
|
if options.get('mode', 'push') == 'pull':
|
|
|
|
if options.get('mode', 'push') == 'pull':
|
|
|
|
(dest_host, src_host) = (src_host, dest_host)
|
|
|
|
(dest_host, src_host) = (src_host, dest_host)
|
|
|
|
if not dest_host is src_host:
|
|
|
|
if not dest_host is src_host:
|
|
|
|