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

Set 'hostvars' before performing variable replacements

This commit is contained in:
Daniel Néri 2012-05-13 20:36:08 +02:00
parent 60d44e1a01
commit 4b0480dd9d

View file

@ -257,8 +257,8 @@ def varReplace(raw, vars):
def template(text, vars, setup_cache, no_engine=True):
''' run a text buffer through the templating engine '''
vars = vars.copy()
text = varReplace(unicode(text), vars)
vars['hostvars'] = setup_cache
text = varReplace(unicode(text), vars)
if no_engine:
# used when processing include: directives so that Jinja is evaluated
# in a later context when more variables are available