When failing because of vars_files templating, try and bubble up the file/line info
This commit is contained in:
parent
f61fb9787d
commit
1076155d8d
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue