From 8769f03c1679728650e93d93ef0b6f7a13bd370a Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Mon, 21 Sep 2015 09:32:35 -0400 Subject: [PATCH] Also catch AnsibleUndefinedVariable errors when templating vars_files names Fixes #12449 --- lib/ansible/vars/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/vars/__init__.py b/lib/ansible/vars/__init__.py index d31fd43581d..c83d07542ce 100644 --- a/lib/ansible/vars/__init__.py +++ b/lib/ansible/vars/__init__.py @@ -33,7 +33,7 @@ except ImportError: from ansible import constants as C from ansible.cli import CLI -from ansible.errors import AnsibleError +from ansible.errors import AnsibleError, AnsibleUndefinedVariable from ansible.inventory.host import Host from ansible.parsing import DataLoader from ansible.plugins.cache import FactCache @@ -238,7 +238,7 @@ class VariableManager: break else: raise AnsibleError("vars file %s was not found" % vars_file_item) - except UndefinedError: + except (UndefinedError, AnsibleUndefinedVariable): continue if not C.DEFAULT_PRIVATE_ROLE_VARS: