Fix exception when including tasks from handlers (#47307)

Set _notified_handlers for the task's _uuid that is run as a handler

Fix #47287
This commit is contained in:
Pablo 2018-10-22 17:46:36 +02:00 committed by Matt Martz
commit 6497049f2a
4 changed files with 25 additions and 1 deletions

View file

@ -952,9 +952,12 @@ class StrategyBase:
iterator._play.handlers.append(block)
iterator.cache_block_tasks(block)
for task in block.block:
task_name = task.get_name()
display.debug("adding task '%s' included in handler '%s'" % (task_name, handler_name))
self._notified_handlers[task._uuid] = included_file._hosts[:]
result = self._do_handler_run(
handler=task,
handler_name=task.get_name(),
handler_name=task_name,
iterator=iterator,
play_context=play_context,
notified_hosts=included_file._hosts[:],