mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
Revert "Removing explicit setting of failed/failed_when"
This reverts commit 4e528e9535
.
This commit is contained in:
parent
4e528e9535
commit
ccf646665b
2 changed files with 7 additions and 3 deletions
|
@ -463,6 +463,10 @@ class TaskExecutor:
|
||||||
cond.when = self._task.failed_when
|
cond.when = self._task.failed_when
|
||||||
failed_when_result = cond.evaluate_conditional(templar, vars_copy)
|
failed_when_result = cond.evaluate_conditional(templar, vars_copy)
|
||||||
result['failed_when_result'] = result['failed'] = failed_when_result
|
result['failed_when_result'] = result['failed'] = failed_when_result
|
||||||
|
else:
|
||||||
|
failed_when_result = False
|
||||||
|
result['failed'] = result.get('failed', False)
|
||||||
|
return failed_when_result
|
||||||
|
|
||||||
if 'ansible_facts' in result:
|
if 'ansible_facts' in result:
|
||||||
vars_copy.update(result['ansible_facts'])
|
vars_copy.update(result['ansible_facts'])
|
||||||
|
|
|
@ -70,11 +70,11 @@ class Task(Base, Conditional, Taggable, Become):
|
||||||
|
|
||||||
_any_errors_fatal = FieldAttribute(isa='bool')
|
_any_errors_fatal = FieldAttribute(isa='bool')
|
||||||
_async = FieldAttribute(isa='int', default=0)
|
_async = FieldAttribute(isa='int', default=0)
|
||||||
_changed_when = FieldAttribute(isa='list')
|
_changed_when = FieldAttribute(isa='list', default=[])
|
||||||
_delay = FieldAttribute(isa='int', default=5)
|
_delay = FieldAttribute(isa='int', default=5)
|
||||||
_delegate_to = FieldAttribute(isa='string')
|
_delegate_to = FieldAttribute(isa='string')
|
||||||
_delegate_facts = FieldAttribute(isa='bool', default=False)
|
_delegate_facts = FieldAttribute(isa='bool', default=False)
|
||||||
_failed_when = FieldAttribute(isa='list')
|
_failed_when = FieldAttribute(isa='list', default=[])
|
||||||
_first_available_file = FieldAttribute(isa='list')
|
_first_available_file = FieldAttribute(isa='list')
|
||||||
_loop = FieldAttribute(isa='string', private=True)
|
_loop = FieldAttribute(isa='string', private=True)
|
||||||
_loop_args = FieldAttribute(isa='list', private=True)
|
_loop_args = FieldAttribute(isa='list', private=True)
|
||||||
|
@ -83,7 +83,7 @@ class Task(Base, Conditional, Taggable, Become):
|
||||||
_poll = FieldAttribute(isa='int')
|
_poll = FieldAttribute(isa='int')
|
||||||
_register = FieldAttribute(isa='string')
|
_register = FieldAttribute(isa='string')
|
||||||
_retries = FieldAttribute(isa='int', default=3)
|
_retries = FieldAttribute(isa='int', default=3)
|
||||||
_until = FieldAttribute(isa='list')
|
_until = FieldAttribute(isa='list', default=[])
|
||||||
|
|
||||||
def __init__(self, block=None, role=None, task_include=None):
|
def __init__(self, block=None, role=None, task_include=None):
|
||||||
''' constructors a task, without the Task.load classmethod, it will be pretty blank '''
|
''' constructors a task, without the Task.load classmethod, it will be pretty blank '''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue