mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-22 22:11:44 -07:00
allow references to names of variables in with_items without needing to surround them with Jinja2 '{{' delimeters
This commit is contained in:
parent
9ac25bb8f6
commit
f0b21dcc0f
5 changed files with 61 additions and 40 deletions
|
@ -435,7 +435,12 @@ def template_from_string(basedir, data, vars):
|
|||
raise errors.AnsibleError("recursive loop detected in template string: %s" % data)
|
||||
else:
|
||||
return data
|
||||
|
||||
|
||||
def test_foo():
|
||||
return 'test_foo!'
|
||||
|
||||
t.globals['test_foo'] = test_foo
|
||||
|
||||
res = jinja2.utils.concat(t.root_render_func(t.new_context(_jinja2_vars(basedir, vars, t.globals), shared=True)))
|
||||
return res
|
||||
except jinja2.exceptions.UndefinedError:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue