From 11beb38c66d1d889eeed7fe36047f3f0bb7adc07 Mon Sep 17 00:00:00 2001 From: Timothy Appnel Date: Mon, 29 Jul 2013 17:56:46 -0400 Subject: [PATCH] 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. --- lib/ansible/runner/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index 9ee9e54a12..929c11daca 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -503,6 +503,8 @@ class Runner(object): self.callbacks.on_skipped(host, inject.get('item',None)) return ReturnData(host=host, result=result) + if getattr(handler, 'setup', None) is not None: + handler.setup(module_name, inject) conn = None actual_host = inject.get('ansible_ssh_host', host) actual_port = port