Publishing to and using Ansible Galaxy roles
Now that we know what a role is and have seen how using them can make our Ansible playbooks a little cleaner and repeatable, we should look at how we can publish our roles to Ansible Galaxy and use them from there in our playbooks.
Publishing your roles to Ansible Galaxy
You need two main prerequisites when publishing your role to Ansible Galaxy: an active GitHub account, which will be used to authenticate to Ansible Galaxy, and a public GitHub repository containing the code for your role.
In this example, I am going to be using my own GitHub account; you can find me at http://github.com/russmckendrick/. I will be using a repository that can be found at https://github.com/russmckendrick/ansible-role-learnansible-example/.
To publish your role, you need to take the following steps:
- Go to the Ansible Galaxy website, which can be found at https://galaxy.ansible.com/, and click on the GitHub logo to log in:
...