Ansible Roles by Application

From rbachwiki
Revision as of 16:20, 14 July 2022 by Bacchas (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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


Ansible Menu