docs: try to clarify handlers a bit more (#49322)
* docs: try to clarify handlers a bit more * docs: refines description of duplicate handler names
This commit is contained in:
parent
e2f85b3f6c
commit
d20d66dc2f
1 changed files with 7 additions and 10 deletions
|
@ -422,14 +422,14 @@ a shared source like Galaxy).
|
||||||
.. note::
|
.. note::
|
||||||
* Notify handlers are always run in the same order they are defined, `not` in the order listed in the notify-statement. This is also the case for handlers using `listen`.
|
* Notify handlers are always run in the same order they are defined, `not` in the order listed in the notify-statement. This is also the case for handlers using `listen`.
|
||||||
* Handler names and `listen` topics live in a global namespace.
|
* Handler names and `listen` topics live in a global namespace.
|
||||||
* If two handler tasks have the same name, only one will run.
|
* Use unique handler names. If you trigger more than one handler with the same name, the first one(s) get overwritten. Only the last one defined will run.
|
||||||
`* <https://github.com/ansible/ansible/issues/4943>`_
|
|
||||||
* You cannot notify a handler that is defined inside of an include. As of Ansible 2.1, this does work, however the include must be `static`.
|
* You cannot notify a handler that is defined inside of an include. As of Ansible 2.1, this does work, however the include must be `static`.
|
||||||
|
|
||||||
Roles are described later on, but it's worthwhile to point out that:
|
Roles are described later on, but it's worthwhile to point out that:
|
||||||
|
|
||||||
* handlers notified within ``pre_tasks``, ``tasks``, and ``post_tasks`` sections are automatically flushed in the end of section where they were notified;
|
* handlers notified within ``pre_tasks``, ``tasks``, and ``post_tasks`` sections are automatically flushed in the end of section where they were notified,
|
||||||
* handlers notified within ``roles`` section are automatically flushed in the end of ``tasks`` section, but before any ``tasks`` handlers.
|
* handlers notified within ``roles`` section are automatically flushed in the end of ``tasks`` section, but before any ``tasks`` handlers,
|
||||||
|
* handlers are play scoped and as such can be used outside of the role they are defined in.
|
||||||
|
|
||||||
If you ever want to flush all the handler commands immediately you can do this::
|
If you ever want to flush all the handler commands immediately you can do this::
|
||||||
|
|
||||||
|
@ -506,6 +506,3 @@ can do this::
|
||||||
Complete end-to-end playbook examples
|
Complete end-to-end playbook examples
|
||||||
`Mailing List <https://groups.google.com/group/ansible-project>`_
|
`Mailing List <https://groups.google.com/group/ansible-project>`_
|
||||||
Questions? Help? Ideas? Stop by the list on Google Groups
|
Questions? Help? Ideas? Stop by the list on Google Groups
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue