Commit 2288a11b by Timothy Appnel

Implemented setup method in rsync action module.

parent 4a9635e0
...@@ -38,6 +38,11 @@ class ActionModule(object): ...@@ -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): ...@@ -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':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment