From 14499e8bf3ed10f7818ec67e1f865d68e4a2a60b Mon Sep 17 00:00:00 2001 From: James Tanner Date: Thu, 20 Mar 2014 16:09:58 -0400 Subject: [PATCH] Fixes #4325 allow async and poll parameters to be templated vars --- lib/ansible/playbook/task.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ansible/playbook/task.py b/lib/ansible/playbook/task.py index 11b356f99a..dd76c47a05 100644 --- a/lib/ansible/playbook/task.py +++ b/lib/ansible/playbook/task.py @@ -206,8 +206,12 @@ class Task(object): self.changed_when = ds.get('changed_when', None) self.failed_when = ds.get('failed_when', None) - self.async_seconds = int(ds.get('async', 0)) # not async by default - self.async_poll_interval = int(ds.get('poll', 10)) # default poll = 10 seconds + 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 = 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 = int(self.async_poll_interval) self.notify = ds.get('notify', []) self.first_available_file = ds.get('first_available_file', None)