Fix correct variable expansion in includes only_if.

There's not need to run the complete include through the templating engine.
Several variables were not included before the conditional was evaluated.
This commit is contained in:
Jeroen Hoekx 2012-05-11 15:06:34 +02:00
parent dab50574e0
commit cd9f926b5f
6 changed files with 61 additions and 6 deletions

View file

@ -160,8 +160,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, SETUP_CACHE, no_engine=True)
included = utils.parse_yaml(included)
included = utils.parse_yaml_from_file(path)
for x in included:
if len(include_vars):
x["vars"] = include_vars