1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Template the source file of the copy module.

This commit is contained in:
Jeroen Hoekx 2012-04-18 11:40:15 +02:00
parent 8da67ea4f5
commit b678cf783c

View file

@ -369,6 +369,10 @@ class Runner(object):
if source is None or dest is None: if source is None or dest is None:
return (host, True, dict(failed=True, msg="src and dest are required"), '') return (host, True, dict(failed=True, msg="src and dest are required"), '')
# apply templating to source argument
inject = self.setup_cache.get(conn.host,{})
source = utils.template(source, inject)
# transfer the file to a remote tmp location # transfer the file to a remote tmp location
tmp_src = tmp + source.split('/')[-1] tmp_src = tmp + source.split('/')[-1]
conn.put_file(utils.path_dwim(self.basedir, source), tmp_src) conn.put_file(utils.path_dwim(self.basedir, source), tmp_src)