From a07f69cd5407e19cfd9ed24556fbe7b6cdea605e Mon Sep 17 00:00:00 2001 From: Matthew Williams Date: Tue, 8 May 2012 07:11:32 -0700 Subject: [PATCH] Template dest and src parameters --- lib/ansible/runner.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/ansible/runner.py b/lib/ansible/runner.py index cde1ecee172..135130c5750 100644 --- a/lib/ansible/runner.py +++ b/lib/ansible/runner.py @@ -430,10 +430,18 @@ class Runner(object): if source is None or dest is None: 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 dest = "%s/%s/%s" % (utils.path_dwim(self.basedir, dest), host, source) 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 local_md5 = None if os.path.exists(dest):