i was hitting a wall with one big playbook until i split it up! now instead of having everything in this huge monolithic file called
/site. yml
, each service gets its own home. check out how simple the new structure looks:
- '''/roles/web_servers- nginx- 'apache'
- '''workstations' - for all user machines
> just what i needed to keep them consistent and manageablei can now easily add or modify servers by calling roles, like casting a spell. e. g, creating new web server: ansible-playbook -role-web_servers
but here's the catch - does this approach slow down playbook execution? any thoughts on performance impact when using multiple role directories?
anyone else tried breaking their playbooks into smaller pieces and found it easier to maintain or manage over time?
let me know what u think!
full read:
https://dev.to/oofemi/clean-code-for-devops-refactoring-my-ansible-lab-into-roles-1j84