notify
The task keyword that names one or more handlers to run later if this task reports changed.
In more detail
The handler name in notify must match the handler's name exactly, including capitals. Several notifications of the same handler still produce a single run at the end of the play, so a batch of configuration edits leads to one reload rather than many.
Example
notify: Record a reloadRelated terms
- handler — A task that runs only when another task notifies it and reports changed, typically to reload or restart a service.
- changed — The task result meaning the module ran and altered the host to make it match the description.
Taught in
- Handlers And Notify — Ansible Configuration Management at Scale
- Templates With Jinja — Ansible Configuration Management at Scale
- Anatomy Of A Playbook: Plays, Tasks And Modules — RHCE in Ansible (EX294): Automate Red Hat Systems
- Handlers And Failure: notify, block, rescue And always — RHCE in Ansible (EX294): Automate Red Hat Systems
- Roles: The Directory Ansible Expects, Defaults And Handlers — RHCE in Ansible (EX294): Automate Red Hat Systems
- RHEL System Roles: timesync And selinux From A Collection — RHCE in Ansible (EX294): Automate Red Hat Systems
- Services And Boot Targets: Started Is Not Enabled — RHCE in Ansible (EX294): Automate Red Hat Systems