Posts tagged iac

Ansible Playbook Refactoring into Roles

In a previous post (Monitoring with Prometheus), we created one playbook which contained all the logic. This post will show how to do a refactoring of a playbook into smaller, reusable Ansible Roles. This allows us to hide complexity and to provide defined interfaces. It also increases the ability to work in parallel on different parts of your Infrastructure as Code (IaC) project. I won’t explore how you publish your roles to Ansible Galaxy but merely show a basic recipe how you move Playbook logic step by step into project specific roles.

Read more ...