mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-12 20:00:58 +00:00
Set 'hostvars' before performing variable replacements
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user