Quiz Entry - updated: 2026.11.12
Why shouldn't handlers be used as a substitute for normal tasks?
Handlers exist to run an extra action because a task changed something; work that must always happen belongs in a normal task.
A handler runs only if something notified it and only at a flush point, usually the end of the play. That makes it the wrong place for anything the play needs unconditionally or in a fixed position:
- if no task reports
changed, the handler doesn't run at all; - if a task fails before the end of the play, queued handlers are dropped (unless
force_handlersis set); - the work happens later than it is written, so tasks in between can't rely on it.
Handlers fit "restart, reload or reboot because the configuration changed". Installing a package or making sure a service is enabled is a normal task.
Go deeper:
Handlers: limitations (official docs) โ what handlers can't do.