Merge pull request #9772 from jszwedko/allow-template-for-retries

Allow retries to be templatable
This commit is contained in:
Brian Coca 2015-02-03 07:08:22 -05:00
commit 7ea2aff272

View file

@ -1034,7 +1034,7 @@ class Runner(object):
cond = template.template(self.basedir, until, inject, expand_lists=False) cond = template.template(self.basedir, until, inject, expand_lists=False)
if not utils.check_conditional(cond, self.basedir, inject, fail_on_undefined=self.error_on_undefined_vars): if not utils.check_conditional(cond, self.basedir, inject, fail_on_undefined=self.error_on_undefined_vars):
retries = self.module_vars.get('retries') retries = template.template(self.basedir, self.module_vars.get('retries'), inject, expand_lists=False)
delay = self.module_vars.get('delay') delay = self.module_vars.get('delay')
for x in range(1, int(retries) + 1): for x in range(1, int(retries) + 1):
# template the delay, cast to float and sleep # template the delay, cast to float and sleep