mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-31 13:29:08 -07:00
Fix handlers on strategy free (#33011)
Add _flushed_hosts dict to store when handlers are flushed and prevent them to be executed too early using _filter_notified_hosts. Add _wait_on_handler_results to wait only for handlers to be completed. Remove only hosts that have been flushed from handler notified list. Fix #31504, #23970
This commit is contained in:
parent
ec2aa12581
commit
5f953d1129
2 changed files with 66 additions and 8 deletions
|
@ -49,6 +49,15 @@ except ImportError:
|
|||
|
||||
class StrategyModule(StrategyBase):
|
||||
|
||||
def _filter_notified_hosts(self, notified_hosts):
|
||||
'''
|
||||
Filter notified hosts accordingly to strategy
|
||||
'''
|
||||
|
||||
# We act only on hosts that are ready to flush handlers
|
||||
return [host for host in notified_hosts
|
||||
if host in self._flushed_hosts and self._flushed_hosts[host]]
|
||||
|
||||
def run(self, iterator, play_context):
|
||||
'''
|
||||
The "free" strategy is a bit more complex, in that it allows tasks to
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue