Thursday, August 22, 2019

Types of ways to get Roles and Ansbile Galaxy

Getting Roles:

Create your own roles: Perfect for proprietary applications or workflows

Find roles to download:
Look for others that had the same requirement and shared their work.

Ansible Galaxy is the place here we download,share,review the roles.

To search a role from shell:
ansible-galazy search apache

Installing Galaxy Roles:

ansible-galaxy install username.role

Example: sudo ansile-galaxy install geerlingguy.git geerlingguy.mysql


 http://galaxy.ansible.com

click on explore to see roles and browse to search for roles.

Default role download location: /etc/ansible/roles

Sample playbook uses above roles downloaded:

test.yml

---

- hosts: gui
  become: yes
  roles:
    - geerlingguy.apache
    - gerrlingguy.mysql


ansible-playbook test.yml 
Roles are generally with .yml extension rather than .yaml

No comments:

Post a Comment