summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cammarata <jimi@sngx.net>2014-12-03 09:27:27 -0600
committerJames Cammarata <jimi@sngx.net>2014-12-04 15:59:14 -0600
commit139327263233ab5dbd2f53894f633f1991a26824 (patch)
tree566dbc2ccdd8d855cb2a1aded5a47b952699b1a7
parent4cd87ec93ec1f5266e5afaaa8e6734d642284afe (diff)
downloadansible-139327263233ab5dbd2f53894f633f1991a26824.tar.gz
Use more variable sources when templating the play ds
Fixes #9699
-rw-r--r--lib/ansible/playbook/play.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py
index 882d174c0a..6e7cc0fc94 100644
--- a/lib/ansible/playbook/play.py
+++ b/lib/ansible/playbook/play.py
@@ -108,10 +108,16 @@ class Play(object):
self._update_vars_files_for_host(None)
# template everything to be efficient, but do not pre-mature template
- # tasks/handlers as they may have inventory scope overrides
+ # tasks/handlers as they may have inventory scope overrides. We also
+ # create a set of temporary variables for templating, so we don't
+ # trample on the existing vars structures
_tasks = ds.pop('tasks', [])
_handlers = ds.pop('handlers', [])
- ds = template(basedir, ds, self.vars)
+
+ temp_vars = utils.merge_hash(self.vars, self.vars_file_vars)
+ temp_vars = utils.merge_hash(temp_vars, self.playbook.extra_vars)
+
+ ds = template(basedir, ds, temp_vars)
ds['tasks'] = _tasks
ds['handlers'] = _handlers