|
|
@ -338,7 +338,10 @@ def template_from_string(basedir, data, vars, fail_on_undefined=False):
|
|
|
|
res = jinja2.utils.concat(rf)
|
|
|
|
res = jinja2.utils.concat(rf)
|
|
|
|
except TypeError, te:
|
|
|
|
except TypeError, te:
|
|
|
|
if 'StrictUndefined' in str(te):
|
|
|
|
if 'StrictUndefined' in str(te):
|
|
|
|
raise errors.AnsibleUndefinedVariable("unable to look up a name or access an attribute in template string")
|
|
|
|
raise errors.AnsibleUndefinedVariable(
|
|
|
|
|
|
|
|
"Unable to look up a name or access an attribute in template string. " + \
|
|
|
|
|
|
|
|
"Make sure your variable name does not contain invalid characters like '-'."
|
|
|
|
|
|
|
|
)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
raise errors.AnsibleError("an unexpected type error occured. Error was %s" % te)
|
|
|
|
raise errors.AnsibleError("an unexpected type error occured. Error was %s" % te)
|
|
|
|
return res
|
|
|
|
return res
|
|
|
|