Fixing bugs with {changed,failed}_when and until with registered vars

* Saving of the registered variable was occuring after the tests for
  changed/failed_when.
* Each of the above fields and until were being post_validated too early,
  so variables which were not defined at that time were causing task
  failures.

Fixes #13591
This commit is contained in:
James Cammarata 2015-12-18 10:58:55 -05:00
parent 1debc2da44
commit a3dcb910b8
2 changed files with 26 additions and 6 deletions

View file

@ -260,6 +260,27 @@ class Task(Base, Conditional, Taggable, Become):
break
return templar.template(value, convert_bare=True)
def _post_validate_changed_when(self, attr, value, templar):
'''
changed_when is evaluated after the execution of the task is complete,
and should not be templated during the regular post_validate step.
'''
return value
def _post_validate_failed_when(self, attr, value, templar):
'''
failed_when is evaluated after the execution of the task is complete,
and should not be templated during the regular post_validate step.
'''
return value
def _post_validate_until(self, attr, value, templar):
'''
until is evaluated after the execution of the task is complete,
and should not be templated during the regular post_validate step.
'''
return value
def get_vars(self):
all_vars = dict()
if self._block: