From 1076155d8db9abd25464812ff864015d95ccf4a6 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Tue, 22 Sep 2015 12:13:32 -0400 Subject: [PATCH] When failing because of vars_files templating, try and bubble up the file/line info --- lib/ansible/vars/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/vars/__init__.py b/lib/ansible/vars/__init__.py index 684b4546213..11b0a491ea1 100644 --- a/lib/ansible/vars/__init__.py +++ b/lib/ansible/vars/__init__.py @@ -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