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

dont break everything when one of the vars in inject does not template correctly, wait till its used

This commit is contained in:
Brian Coca 2015-03-31 21:36:18 -04:00
parent 57ed994766
commit 17e086fe8c

View file

@ -188,7 +188,11 @@ class _jinja2_vars(object):
if isinstance(var, dict) and varname == "vars" or isinstance(var, HostVars):
return var
else:
return template(self.basedir, var, self.vars, fail_on_undefined=self.fail_on_undefined)
try:
return template(self.basedir, var, self.vars, fail_on_undefined=self.fail_on_undefined)
except:
raise KeyError("undefined variable: %s" % varname)
def add_locals(self, locals):
'''