Commit 11beb38c by Timothy Appnel

Added support of an optional setup method for action modules like rsync that…

Added support of an optional setup method for action modules like rsync that need to alter the connection and other inject data before it's established.
parent 1fd863cf
...@@ -503,6 +503,8 @@ class Runner(object): ...@@ -503,6 +503,8 @@ class Runner(object):
self.callbacks.on_skipped(host, inject.get('item',None)) self.callbacks.on_skipped(host, inject.get('item',None))
return ReturnData(host=host, result=result) return ReturnData(host=host, result=result)
if getattr(handler, 'setup', None) is not None:
handler.setup(module_name, inject)
conn = None conn = None
actual_host = inject.get('ansible_ssh_host', host) actual_host = inject.get('ansible_ssh_host', host)
actual_port = port actual_port = port
......
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