Ansible Roles by Application
Revision as of 20:19, 12 July 2022 by Bacchas (talk | contribs) (Created page with "==Create Roles based on Applications== ===To Create Role=== cd /etc/ansible/roles * Make a Directory for each role Mkdir apache mkdir phpmyadmin mkdir tmux * Create sub-directory ''tasks''' within each directory Mkdir apache/tasks mkdir phpmyadmin/tasks mkdir tmux/tasks * Create yml file within these sub-directories touch apache/tasks/main.yml touch phpmyadmin/tasks/main.yml touch tmux/tasks/main.yml ==Write your yml file and install those apps == ---...")
Create Roles based on Applications
To Create Role
cd /etc/ansible/roles
- Make a Directory for each role
Mkdir apache mkdir phpmyadmin mkdir tmux
- Create sub-directory tasks' within each directory
Mkdir apache/tasks mkdir phpmyadmin/tasks mkdir tmux/tasks
- Create yml file within these sub-directories
touch apache/tasks/main.yml touch phpmyadmin/tasks/main.yml touch tmux/tasks/main.yml
Write your yml file and install those apps
--- - name: install packages hosts: all roles: - apache - phpmyadmin - tmux