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

Merge pull request #331 from mgwilliams/bug-fetch-module

Template dest and src parameters
This commit is contained in:
Michael DeHaan 2012-05-08 11:11:13 -07:00
commit ee34c0c154

View file

@ -430,10 +430,18 @@ 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,{})
print source
source = utils.template(source, inject, self.setup_cache)
# files are saved in dest dir, with a subdir for each host, then the filename # files are saved in dest dir, with a subdir for each host, then the filename
dest = "%s/%s/%s" % (utils.path_dwim(self.basedir, dest), host, source) dest = "%s/%s/%s" % (utils.path_dwim(self.basedir, dest), host, source)
dest = dest.replace("//","/") dest = dest.replace("//","/")
# apply templating to dest argument
dest = utils.template(dest, inject, self.setup_cache)
# compare old and new md5 for support of change hooks # compare old and new md5 for support of change hooks
local_md5 = None local_md5 = None
if os.path.exists(dest): if os.path.exists(dest):