Working With Ansible Roles
Roles provide a framework for fully independent, or interdependent collections of variables, tasks, files, templates, and modules.
- From previous labs, our playbooks has grown and can be complex, time to use roles
- Create a new directory in /home/ec2-user:
mkdir ansible-roles
- Lets initial roles structure in this directory:
ansible-galaxy webservers init
- This is will initiate directory structure for roles:
- Now next step would be to copy content from setup-app.yml to individual main.yml, please refer this link
- For more roles please visit galaxy.ansible.com