From 7124504ccfd837d6a8e4124d619fb605ae92e0b0 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Tue, 21 Jul 2015 02:10:26 -0400 Subject: [PATCH] Incorporate extra vars when templating vars_files Fixes #11377 --- lib/ansible/vars/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ansible/vars/__init__.py b/lib/ansible/vars/__init__.py index 599499ca2a..fa4bb15f10 100644 --- a/lib/ansible/vars/__init__.py +++ b/lib/ansible/vars/__init__.py @@ -188,7 +188,11 @@ class VariableManager: if play: all_vars = self._combine_vars(all_vars, play.get_vars()) - templar = Templar(loader=loader, variables=all_vars) + + # create a set of temporary vars here, which incorporate any extra vars + # which may have been specified, so we can properly template vars_files + temp_vars = self._combine_vars(all_vars, self.extra_vars) + templar = Templar(loader=loader, variables=temp_vars) for vars_file_item in play.get_vars_files(): try: