mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user