mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-02 22:39:09 -07:00
Implemented setup method in rsync action module.
This commit is contained in:
parent
4a9635e04e
commit
2288a11b6a
1 changed files with 5 additions and 4 deletions
|
@ -38,6 +38,11 @@ class ActionModule(object):
|
||||||
else:
|
else:
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
def setup(self, module_name, inject):
|
||||||
|
''' Always default to localhost as delegate if None defined '''
|
||||||
|
if inject.get('delegate_to') is None:
|
||||||
|
inject['delegate_to'] = '127.0.0.1'
|
||||||
|
|
||||||
def run(
|
def run(
|
||||||
self,
|
self,
|
||||||
conn,
|
conn,
|
||||||
|
@ -65,10 +70,6 @@ class ActionModule(object):
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# the localhost is the default delegate in an rsync task
|
|
||||||
if inject.get('delegate_to') is None:
|
|
||||||
conn.delegate = '127.0.0.1'
|
|
||||||
inject['delegate_to'] = '127.0.0.1'
|
|
||||||
src_host = inject['delegate_to']
|
src_host = inject['delegate_to']
|
||||||
dest_host = inject.get('ansible_ssh_host', inject['inventory_hostname'])
|
dest_host = inject.get('ansible_ssh_host', inject['inventory_hostname'])
|
||||||
if options.get('mode', 'push') == 'pull':
|
if options.get('mode', 'push') == 'pull':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue