diff options
author | James Cammarata <jimi@sngx.net> | 2014-08-07 13:28:09 -0500 |
---|---|---|
committer | James Cammarata <jimi@sngx.net> | 2014-08-14 15:00:57 -0500 |
commit | adcd53c67e6f2d46dabe7ca677099dc74a0da0fe (patch) | |
tree | ddf5451ab7a6302a2e44effc2386fd84b2e9c4af | |
parent | 4eb5faa1b5874ba724811fb665e3f8bac1b2dafb (diff) | |
download | ansible-adcd53c67e6f2d46dabe7ca677099dc74a0da0fe.tar.gz |
Make sure default vars are used in template calls for tasks
Fixes #8499
-rw-r--r-- | lib/ansible/playbook/task.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/ansible/playbook/task.py b/lib/ansible/playbook/task.py index 4d3eab382f..49aa10fca5 100644 --- a/lib/ansible/playbook/task.py +++ b/lib/ansible/playbook/task.py @@ -208,11 +208,15 @@ class Task(object): self.changed_when = ds.get('changed_when', None) self.failed_when = ds.get('failed_when', None) + # combine the default and module vars here for use in templating + all_vars = self.default_vars.copy() + all_vars = utils.combine_vars(all_vars, self.module_vars) + self.async_seconds = ds.get('async', 0) # not async by default - self.async_seconds = template.template_from_string(play.basedir, self.async_seconds, self.module_vars) + self.async_seconds = template.template_from_string(play.basedir, self.async_seconds, all_vars) self.async_seconds = int(self.async_seconds) self.async_poll_interval = ds.get('poll', 10) # default poll = 10 seconds - self.async_poll_interval = template.template_from_string(play.basedir, self.async_poll_interval, self.module_vars) + self.async_poll_interval = template.template_from_string(play.basedir, self.async_poll_interval, all_vars) self.async_poll_interval = int(self.async_poll_interval) self.notify = ds.get('notify', []) self.first_available_file = ds.get('first_available_file', None) |