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.
Ansible roles consist of many playbooks, which is a way to group multiple tasks into one container to do the automation in a very effective manner with clean, directory structures.
Ansible Galaxy Commands
Here are some helpful Ansible Galaxy commands, such as:
Create Roles with Ansible Galaxy
The Ansible Galaxy is essentially a large public repository of Ansible roles. Roles ship with READMEs detailing the roles use and variables. Ansible Galaxy contains a large number of roles that are continually evolving and increasing.
The Galaxy can use Git to add other role sources like GitHub. You can initialize a new galaxy role using the ansible-galaxy init or install a role directly from the Ansible galaxy role store by executing the ansible-galaxy install <name of role> command.
To create an Ansible role using the 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.
Ansible Galaxy has been a tool for constructing and managing roles with new iterations of the Ansible, and you are bound to see changes or additions. On Ansible version 2.8, you get the unique feature of the collections.
Collections are the distribution format for the Ansible content. They can be used to package and distribute roles, modules, playbooks, and plugins.
Collections follow the following simple structure:
The ansible-galaxy-collection command implements the following commands. Some commands are the same as used with ansible-galaxy, such as: