mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 15:11:23 -07:00
Fix any_errors_fatal incorrect implementation in 2.0
Also adds that flag to blocks. Fixes #13744
This commit is contained in:
parent
acf49cf837
commit
1825b4a9c7
5 changed files with 37 additions and 11 deletions
|
@ -280,6 +280,7 @@ class StrategyModule(StrategyBase):
|
|||
except AnsibleError as e:
|
||||
return False
|
||||
|
||||
include_failure = False
|
||||
if len(included_files) > 0:
|
||||
display.debug("we have included files to process")
|
||||
noop_task = Task()
|
||||
|
@ -325,6 +326,7 @@ class StrategyModule(StrategyBase):
|
|||
self._tqm._failed_hosts[host.name] = True
|
||||
iterator.mark_host_failed(host)
|
||||
display.error(e, wrap_text=False)
|
||||
include_failure = True
|
||||
continue
|
||||
|
||||
# finally go through all of the hosts and append the
|
||||
|
@ -338,6 +340,16 @@ class StrategyModule(StrategyBase):
|
|||
display.debug("done processing included files")
|
||||
|
||||
display.debug("results queue empty")
|
||||
|
||||
display.debug("checking for any_errors_fatal")
|
||||
had_failure = include_failure
|
||||
for res in results:
|
||||
if res.is_failed() or res.is_unreachable():
|
||||
had_failure = True
|
||||
break
|
||||
if task and task.any_errors_fatal and had_failure:
|
||||
return False
|
||||
|
||||
except (IOError, EOFError) as e:
|
||||
display.debug("got IOError/EOFError in task loop: %s" % e)
|
||||
# most likely an abort, return failed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue