When failing because of vars_files templating, try and bubble up the file/line info

This commit is contained in:
James Cammarata 2015-09-22 12:13:32 -04:00
parent f61fb9787d
commit 1076155d8d

View file

@ -247,7 +247,7 @@ class VariableManager:
raise AnsibleError("vars file %s was not found" % vars_file_item)
except (UndefinedError, AnsibleUndefinedVariable):
if host is not None and self._fact_cache.get(host.name, dict()).get('module_setup') and task is not None:
raise
raise AnsibleUndefinedVariable("an undefined variable was found when attempting to template the vars_files item '%s'" % vars_file_item, obj=vars_file_item)
else:
# we do not have a full context here, and the missing variable could be
# because of that, so just show a warning and continue