Ensure we don't overwrite handlers from include_role when loading a play. Fixes #18140 (#39563)

pull/39568/head
Matt Martz 6 years ago committed by GitHub
parent 5a6bdef76b
commit 6acdc36317
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -171,7 +171,11 @@ class Play(Base, Taggable, Become):
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)

Loading…
Cancel
Save