Ansible Galaxy
What is Ansible Galaxy?
Ansible Galaxy is a galaxy website where users can share roles and to a command-line tool for installing, creating, and managing roles.
Ansible Galaxy gives greater visibility to one of Ansible's most exciting features, such as application installation or reusable roles for server configuration. Lots of people share roles in the Ansible Galaxy.
To work with Ansible Galaxy, you need to use the ansible-galaxy command and its templates. Roles must be downloaded before they used in the playbooks. They are placed into the default directory that is /etc/ansible/roles, also depends on your version, they might placed in your current user home directory.
Currently we don't have any roles in default place:
Search on Galaxy
ansible-galaxy search searches for roles on the Ansible Galaxy server. Lets search for apache for example:
Download from Galaxy
Use the ansible-galaxy install command to download roles from the Galaxy server
Lets take look at what it has downloaded:
For using downloaded role, we have to create a simple playbook:
and like always run it:
and it runs tons of tasks.
Upload to Galaxy
To upload a role to ansibel galaxy, first you have to upload it to your github project and next log in to your ansible galaxy account and pull that, That's all.
.
.
.
https://www.redhat.com/sysadmin/ansible-galaxy-intro
https://www.javatpoint.com/ansible-galaxy
https://docs.ansible.com/ansible/latest/cli/ansible-galaxy.html
https://galaxy.ansible.com/docs/using/installing.html
.
Last updated
Was this helpful?