synchronize: allow ansible_ssh_host to be templated

This is already enabled in the runner also.
This commit is contained in:
Serge van Ginderachter 2013-11-25 15:31:56 +01:00
parent 828b9f872f
commit 2f9470ec1d

View file

@ -69,6 +69,8 @@ class ActionModule(object):
# from the perspective of the rsync call the delegate is the localhost # from the perspective of the rsync call the delegate is the localhost
src_host = '127.0.0.1' src_host = '127.0.0.1'
dest_host = inject.get('ansible_ssh_host', inject['inventory_hostname']) 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 # edge case: explicit delegate and dest_host are the same
if dest_host == inject['delegate_to']: if dest_host == inject['delegate_to']: