Category: yaml, ansible

Running tasks in Ansible can be done in different ways and this can be very confusing for those starting out with automation and server orchestration. If I had this post when I started with Ansible it would’ve saved me hours of researching, so hopefully, this helps you.

The disadvantage is that you won’t be able to see what the playbook is actually running and in which other the different tasks are executed.

If you were to compare this to a JavaScript execution cycle, you could say that handlers are additional tasks that are appended to the task list, not executed in between two other tasks.

The advantage of handlers is that you can very easily perform certain tasks and “schedule” a cleanup command for example.

Related Articles