ansible Galaxy Sharing roles with Ansible Galaxy


Example

It's also possible to easily share roles with the community or download roles that have been created by other members of the community with Ansible Galaxy.

Ansible ships with a command line tool called ansible-galaxy that can be used to install roles in the role directory defined in the ansible.cfg file:

ansible-galaxy install username.rolename

You can also use the Ansible Galaxy tool to download roles from other locations such as GitHub by creating a text file with the location defined as src:

- src: https://github.com/username/rolename

And then install the roles in the text file like so:

ansible-galaxy install -r requirements.txt

You can also use the ansible-galaxy tool to create role "scaffolding":

ansible-galaxy init rolename

Once you've created a role and uploaded it to GitHub you can share it on Ansible Galaxy by linking to your GitHub repo in Ansible Galaxy after signing in.

More examples under Galaxy topic.