Commit 3569a2ff by Alek Storm Committed by James Cammarata

Handle AnsibleUndefinedVariable's raised from lookup plugins like jinja2 UndefinedError's

parent 8034231a
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment