Automatically building and publishing Ansible Galaxy Collections
I maintain a large number of Ansible Galaxy roles, and publish hundreds of new releases every year. If the process weren't fully automated, there would be no way I could keep up with it. For Galaxy roles, the process of tagging and publishing a new release is very simple, because Ansible Galaxy ties the role strongly to GitHub's release system. All that's needed is a webhook in your .travis.yml
file (if using Travis CI):
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
For collections, Ansible Galaxy actually hosts an artifact—a .tar.gz file containing the collection contents. This offers some benefits that I won't get into here, but also a challenge: someone has to build and upload that artifact... and that takes more than one or two lines added to a .travis.yml
file.
Until recently, I had been publishing collection releases manually. The process went something like: