mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 12:21:26 -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:
|
||||
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(
|
||||
self,
|
||||
conn,
|
||||
|
@ -65,10 +70,6 @@ class ActionModule(object):
|
|||
except KeyError:
|
||||
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']
|
||||
dest_host = inject.get('ansible_ssh_host', inject['inventory_hostname'])
|
||||
if options.get('mode', 'push') == 'pull':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue