From 12d5b75a438fae53b5ba65bdf44dec0069400bba Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Mon, 6 Oct 2014 10:50:55 -0500 Subject: [PATCH] Template play vars after reading them Fixes #9242 --- lib/ansible/playbook/play.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index ca53bc029eb..742c12b382d 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -84,6 +84,11 @@ class Play(object): if self.playbook.inventory.src() is not None: self.vars['inventory_file'] = self.playbook.inventory.src() + # template the play vars with themselves and the extra vars + # from the playbook, to make sure they're correct + all_vars = utils.combine_vars(self.vars, self.playbook.extra_vars) + self.vars = template(basedir, self.vars, all_vars) + # We first load the vars files from the datastructure # so we have the default variables to pass into the roles self.vars_files = ds.get('vars_files', [])