mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
parent
cc41354733
commit
fc3a44485b
1 changed files with 8 additions and 3 deletions
|
@ -275,9 +275,14 @@ class TaskExecutor:
|
||||||
# the final task post-validation. We do this before the post validation due to
|
# the final task post-validation. We do this before the post validation due to
|
||||||
# the fact that the conditional may specify that the task be skipped due to a
|
# the fact that the conditional may specify that the task be skipped due to a
|
||||||
# variable not being present which would otherwise cause validation to fail
|
# variable not being present which would otherwise cause validation to fail
|
||||||
if not self._task.evaluate_conditional(templar, variables):
|
try:
|
||||||
self._display.debug("when evaluation failed, skipping this task")
|
if not self._task.evaluate_conditional(templar, variables):
|
||||||
return dict(changed=False, skipped=True, skip_reason='Conditional check failed', _ansible_no_log=self._play_context.no_log)
|
self._display.debug("when evaluation failed, skipping this task")
|
||||||
|
return dict(changed=False, skipped=True, skip_reason='Conditional check failed', _ansible_no_log=self._play_context.no_log)
|
||||||
|
except AnsibleError:
|
||||||
|
# skip conditional exception in the case of includes as the vars needed might not be avaiable except in the included tasks or due to tags
|
||||||
|
if self._task.action != 'include':
|
||||||
|
raise
|
||||||
|
|
||||||
# if this task is a TaskInclude, we just return now with a success code so the
|
# if this task is a TaskInclude, we just return now with a success code so the
|
||||||
# main thread can expand the task list for the given host
|
# main thread can expand the task list for the given host
|
||||||
|
|
Loading…
Reference in a new issue