mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 06:10:22 -07:00
Properly fail out of the task loop in the linear strategy on failures (v2)
This commit is contained in:
parent
fba5588028
commit
8fae2abed4
3 changed files with 19 additions and 1 deletions
|
@ -117,15 +117,17 @@ class PlaybookExecutor:
|
|||
if len(batch) == 0:
|
||||
self._tqm.send_callback('v2_playbook_on_play_start', new_play)
|
||||
self._tqm.send_callback('v2_playbook_on_no_hosts_matched')
|
||||
result = 0
|
||||
result = 1
|
||||
break
|
||||
# restrict the inventory to the hosts in the serialized batch
|
||||
self._inventory.restrict_to_hosts(batch)
|
||||
# and run it...
|
||||
result = self._tqm.run(play=play)
|
||||
# if the last result wasn't zero, break out of the serial batch loop
|
||||
if result != 0:
|
||||
break
|
||||
|
||||
# if the last result wasn't zero, break out of the play loop
|
||||
if result != 0:
|
||||
break
|
||||
|
||||
|
@ -134,6 +136,10 @@ class PlaybookExecutor:
|
|||
if entry:
|
||||
entrylist.append(entry) # per playbook
|
||||
|
||||
# if the last result wasn't zero, break out of the playbook file name loop
|
||||
if result != 0:
|
||||
break
|
||||
|
||||
if entrylist:
|
||||
return entrylist
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue