Skip to content

Commit

Permalink
Template handler name
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrizek authored and bcoca committed Jun 25, 2018
1 parent c309381 commit 8b5283f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/ansible/plugins/strategy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,14 @@ def run_handlers(self, iterator, play_context):
# we consider the ability of meta tasks to flush handlers
for handler in handler_block.block:
if handler._uuid in self._notified_handlers and len(self._notified_handlers[handler._uuid]):
result = self._do_handler_run(handler, handler.get_name(), iterator=iterator, play_context=play_context)
handler_vars = self._variable_manager.get_vars(play=iterator._play, task=handler)
templar = Templar(loader=self._loader, variables=handler_vars)
handler_name = handler.get_name()
try:
handler_name = templar.template(handler_name)
except (UndefinedError, AnsibleUndefinedVariable):
pass
result = self._do_handler_run(handler, handler_name, iterator=iterator, play_context=play_context)
if not result:
break
return result
Expand Down

0 comments on commit 8b5283f

Please sign in to comment.