O'Reilly logo

Ansible Configuration Management - Second Edition by Daniel Hall

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The handlers section

The handlers section is syntactically the same as the task section and supports the same format for calling modules. Handlers are called only when the task they were called from, records that something changed during execution. To trigger a handler, add a notify key to the task with the value set to the name of the task.

Handlers are run if previously triggered when Ansible has finished running the task list. They are run in the order that they are listed in the handlers section, and even if they are called multiple times in the task section, they will run only once. This is often used to restart daemons after they have been upgraded and configured. The following play demonstrates how we will upgrade an ISC DHCP (Dynamic Host ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required