Commit 1076155d by James Cammarata

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

parent f61fb978
...@@ -247,7 +247,7 @@ class VariableManager: ...@@ -247,7 +247,7 @@ class VariableManager:
raise AnsibleError("vars file %s was not found" % vars_file_item) raise AnsibleError("vars file %s was not found" % vars_file_item)
except (UndefinedError, AnsibleUndefinedVariable): except (UndefinedError, AnsibleUndefinedVariable):
if host is not None and self._fact_cache.get(host.name, dict()).get('module_setup') and task is not None: 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: else:
# we do not have a full context here, and the missing variable could be # we do not have a full context here, and the missing variable could be
# because of that, so just show a warning and continue # because of that, so just show a warning and continue
......
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