mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Handle AnsibleUndefinedVariable's raised from lookup plugins like jinja2 UndefinedError's
This commit is contained in:
parent
8034231a00
commit
3569a2ffee
1 changed files with 1 additions and 1 deletions
|
@ -511,7 +511,7 @@ def template_from_string(basedir, data, vars, fail_on_undefined=False):
|
|||
|
||||
res = jinja2.utils.concat(t.root_render_func(t.new_context(_jinja2_vars(basedir, vars, t.globals, fail_on_undefined), shared=True)))
|
||||
return res
|
||||
except jinja2.exceptions.UndefinedError:
|
||||
except (jinja2.exceptions.UndefinedError, errors.AnsibleUndefinedVariable):
|
||||
if fail_on_undefined:
|
||||
raise
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue