From 2f9470ec1d3d03feec67afd5a9f38f1d52d8ea1f Mon Sep 17 00:00:00 2001 From: Serge van Ginderachter Date: Mon, 25 Nov 2013 15:31:56 +0100 Subject: [PATCH] synchronize: allow ansible_ssh_host to be templated This is already enabled in the runner also. --- lib/ansible/runner/action_plugins/synchronize.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/runner/action_plugins/synchronize.py b/lib/ansible/runner/action_plugins/synchronize.py index 004deded22e..7e27add8041 100644 --- a/lib/ansible/runner/action_plugins/synchronize.py +++ b/lib/ansible/runner/action_plugins/synchronize.py @@ -69,6 +69,8 @@ class ActionModule(object): # from the perspective of the rsync call the delegate is the localhost src_host = '127.0.0.1' dest_host = inject.get('ansible_ssh_host', inject['inventory_hostname']) + # allow ansible_ssh_host to be templated + dest_host = template.template(self.runner.basedir, dest_host, inject, fail_on_undefined=True) # edge case: explicit delegate and dest_host are the same if dest_host == inject['delegate_to']: