Skip to content

Commit

Permalink
Ensure we don't overwrite handlers from include_role when loading a p…
Browse files Browse the repository at this point in the history
…lay. Fixes #18140 (#39563)
  • Loading branch information
sivel committed May 1, 2018
1 parent 5a6bdef commit 6acdc36
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ansible/playbook/play.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ def _load_handlers(self, attr, ds):
Bare handlers outside of a block are given an implicit block.
'''
try:
return load_list_of_blocks(ds=ds, play=self, use_handlers=True, variable_manager=self._variable_manager, loader=self._loader)
return self._extend_value(
self.handlers,
load_list_of_blocks(ds=ds, play=self, use_handlers=True, variable_manager=self._variable_manager, loader=self._loader),
prepend=True
)
except AssertionError as e:
raise AnsibleParserError("A malformed block was encountered while loading handlers", obj=self._ds, orig_exc=e)

Expand Down

0 comments on commit 6acdc36

Please sign in to comment.