From fa2aebc8a64a6b95d751e902f0dc9e2ca54d0da3 Mon Sep 17 00:00:00 2001 From: Seth Vidal Date: Wed, 25 Apr 2012 11:59:19 -0400 Subject: [PATCH] fix for issue #230 - handle template taking 3 args --- lib/ansible/playbook.py | 4 ++-- lib/ansible/utils.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ansible/playbook.py b/lib/ansible/playbook.py index 4da4975177..102e307f94 100644 --- a/lib/ansible/playbook.py +++ b/lib/ansible/playbook.py @@ -154,7 +154,7 @@ class PlayBook(object): include_vars[k] = v inject_vars = play_vars.copy() inject_vars.update(include_vars) - included = utils.template_from_file(path, inject_vars) + included = utils.template_from_file(path, inject_vars, SETUP_CACHE) included = utils.parse_yaml(included) for x in included: if len(include_vars): @@ -168,7 +168,7 @@ class PlayBook(object): path = utils.path_dwim(dirname, handler['include']) inject_vars = self._get_vars(play, dirname) - included = utils.template_from_file(path, inject_vars) + included = utils.template_from_file(path, inject_vars, SETUP_CACHE) included = utils.parse_yaml(included) for x in included: new_handlers.append(x) diff --git a/lib/ansible/utils.py b/lib/ansible/utils.py index ac4228f2c1..86569bdbf8 100644 --- a/lib/ansible/utils.py +++ b/lib/ansible/utils.py @@ -249,10 +249,10 @@ def template(text, vars, setup_cache): def double_template(text, vars, setup_cache): return template(template(text, vars, setup_cache), vars, setup_cache) -def template_from_file(path, vars): +def template_from_file(path, vars, setup_cache): ''' run a file through the templating engine ''' data = file(path).read() - return template(data, vars) + return template(data, vars, setup_cache) def parse_yaml(data): return yaml.load(data)