summaryrefslogtreecommitdiff
path: root/lib/ansible/executor/task_queue_manager.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ansible/executor/task_queue_manager.py')
-rw-r--r--lib/ansible/executor/task_queue_manager.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/ansible/executor/task_queue_manager.py b/lib/ansible/executor/task_queue_manager.py
index 58b1409d1b..8c09151f26 100644
--- a/lib/ansible/executor/task_queue_manager.py
+++ b/lib/ansible/executor/task_queue_manager.py
@@ -122,10 +122,6 @@ class TaskQueueManager:
inventory hostnames for those hosts triggering the handler.
'''
- handlers = play.handlers
- for role in play.roles:
- handlers.extend(role.get_handler_blocks())
-
# Zero the dictionary first by removing any entries there.
# Proxied dicts don't support iteritems, so we have to use keys()
self._notified_handlers.clear()
@@ -141,7 +137,7 @@ class TaskQueueManager:
return temp_list
handler_list = []
- for handler_block in handlers:
+ for handler_block in play.handlers:
handler_list.extend(_process_block(handler_block))
# then initialize it with the given handler list
@@ -220,6 +216,7 @@ class TaskQueueManager:
new_play = play.copy()
new_play.post_validate(templar)
+ new_play.handlers = new_play.compile_roles_handlers() + new_play.handlers
self.hostvars = HostVars(
inventory=self._inventory,