mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07: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:
parent
1debc2da44
commit
a3dcb910b8
2 changed files with 26 additions and 6 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue