Ansible 9 Custom Roles - Reusability
Hello Guys, welcome back to DevSecOps Automations!! In this post, we will be exploring the Custom role create and usage in a playbook, which is a most industry requirement. It depends on your use cases. It's always recommended to write a role if you have a complex set of tasks consist of handlers and jinja templates. Roles break down a complex playbook into simple and multiple reusable plays easy to read! In the last post, we have learned about how ansible-galaxy helps us to install, create, modify the ready-made roles which are provided by the Ansible community freely on the Galaxy site. What are the roles why we should use them in Ansible? As per my understanding so far following points : A role can be defined when we have to do one or many tasks It is a set of tasks with a single objective (for example reboot of box - stop all process, reboot, start process) You can organize the code in more readable form using roles it is like functions in Python or C Here the main objective i...