DevOps Articles

Curated articles, resources, tips and trends from the DevOps World.

Ansible: Tasks vs Roles vs Handlers

4 years ago medium.com
Ansible: Tasks vs Roles vs Handlers

Summary: This is a summary of an article originally published by the source. Read the full original article here →

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.

Made with pure grit © 2024 Jetpack Labs Inc. All rights reserved. www.jetpacklabs.com