mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
More playbook executor compatibility fixes
With some earlier changes, continuing to forward failed hosts on to the iterator with each TQM run() call was causing plays with max_fail_pct set to fail, as hosts which failed in previous plays were counting those old failures against the % calculation. Also changed the linear strategy's calculation to use the internal failed list, rather than the iterator, as this now represents the hosts failed during the current run only.
This commit is contained in:
parent
aad9f43dda
commit
74a252d0a5
2 changed files with 12 additions and 4 deletions
|
@ -367,7 +367,7 @@ class StrategyModule(StrategyBase):
|
|||
if iterator._play.max_fail_percentage is not None and len(results) > 0:
|
||||
percentage = iterator._play.max_fail_percentage / 100.0
|
||||
|
||||
if (len(iterator.get_failed_hosts()) / len(results)) > percentage:
|
||||
if (len(self._tqm._failed_hosts) / len(results)) > percentage:
|
||||
for host in hosts_left:
|
||||
# don't double-mark hosts, or the iterator will potentially
|
||||
# fail them out of the rescue/always states
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue