mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Prevent duplicately loaded handlers from running more than once.
Fixes #3863
This commit is contained in:
parent
5ed28efe45
commit
f081c68a65
1 changed files with 5 additions and 1 deletions
|
@ -538,10 +538,14 @@ class PlayBook(object):
|
|||
# here a meta task is a placeholder that signals handlers should be run
|
||||
|
||||
if task.meta == 'flush_handlers':
|
||||
fired_names = {}
|
||||
for handler in play.handlers():
|
||||
if len(handler.notified_by) > 0:
|
||||
self.inventory.restrict_to(handler.notified_by)
|
||||
if handler.name not in fired_names:
|
||||
self._run_task(play, handler, True)
|
||||
# prevent duplicate handler includes from running more than once
|
||||
fired_names[handler.name] = 1
|
||||
self.inventory.lift_restriction()
|
||||
new_list = handler.notified_by[:]
|
||||
for host in handler.notified_by:
|
||||
|
|
Loading…
Reference in a new issue