Open tombosmansibm opened 4 years ago
Hello,
What's the reasonning of this PR ? The order of handlers in the YML file have no impact on how they are triggered, right ? They are only listed and can be used if you call them explicitly in a task somewhere else.
Handlers are executed in the order they’re listed. In situations where there are multiple handlers to be executed, you want the “Commit and restart” handler to be executed first (it also handles commit), this avoids ending up with an unresponsive appliance.
Wait, to be sure I get it, you mean that, if you describe in the handlers this:
- handler_A
- handler_B
And in your role/task file this:
- task: ..
notify:
- handler_B
- handler_A
Handler B will be triggered after Handler A because in the handler file it's declared before ? This doesn't make sense to me, bit of weird, no ?
Cédric Servais
That is correct. But the real issue occurs when there's multiple handlers at different places (in different tasks). So for instance, you do multiple tasks, the first one you process notifies "commit and restart", the last one notifies "commit", the order of processing is based on the order in handlers.
Has nothing to do with the IBM Security code, btw, it is Ansible : https://docs.ansible.com/ansible/latest/user_guide/playbooks_handlers.html#controlling-when-handlers-run
Got it,
I wondered indeed :) Thank you !
to avoid that the appliance becomes unresponsive when both "commit" and "commit and restart" handlers are called. Now "commit and restart" is executed first.
See issue 172