Where to store collections

Hi.
In our company, we use AWX as a proof of concept. We have developed some custom collections that need to be stored for use, but we don’t have a private Automation Hub. What would be a suitable place to store these collections?

Thank you

Collections can pretty much be stored anywhere, in a git repo, on the file system, etc. There’s a requirements.yml file you can create to specify whence your collections should be downloaded from. I think Installing collections — Ansible Documentation contains pointers to what you’ll need.

1 Like

@jpmens thank you. I am pretty familiar with collections. I am just curious where other users store collections (some best practices). But I think git will be the right place for me.

I would also keep them in a git (or other SCM) repository and reference that repository from requirements.yml. You can also run your own galaxy_ng instance and store the built collection artifacts there, and then pull the collections from there.

For collections tightly coupled to playbooks/local roles, I would store them next to the playbooks in collections/ and in the same repository where the playbooks are in. This is also useful for collections that are not tightly coupled, but that don’t have a proper place anwhere else yet. (For example if you have only a few self-created collections and don’t want to create a (or multiple) separate repository and use ansible-galaxy collection install to install them from there before you can use it.)

1 Like

I’d wait a bit before doing that until the code is usable. :wink: Seriously though, I’ve always thought that to be a bit overkill for most users as it adds more moving parts in form of yet another service I need to manage.

As I heard it is too unstable :slightly_smiling_face:

That depends a lot whether you talk about roles or collections. For collections, galaxy_ng has been used and shipped to RH customers for years now, as it’s the upstream project for Automation Hub. Since this thread is about collections and not about roles, galaxy_ng should be fine.

1 Like

Do collections need to be packaged in tar.gz format if you want to store them on Git and istall them with ansible-galaxy?

No, that’s not needed.

See Installing collections — Ansible Documentation. You can for example install community.general 7.5.0 from git via ansible-galaxy collection install git+https://github.com/ansible-collectons/community.general.git,7.5.0. This installs community.general from the 7.5.0 tag of the Git repository, and as you can see in GitHub - ansible-collections/community.general at 7.5.0 there is no .tar.gz in there.

For Collections you want to have people consume/other teams use , the best way is the galaxy_ng/Hub, and the infra.ah_configuraiton collection on galaxy is built to help manage it. The server is the best way to scale these with multiple teams making collections or for an enterprise, but likely overkill for a single team.

However for developing collections, that are changing quickly and people are working on, you can install it from git as a project sync is probably the best way to go about it. That also works if you don’t want to set up a galaxy_ng server. This would be set similar to how felix just posted with a requirements.yml file.

Another option wiuld be to put it in EE :slightly_smiling_face:
Anyway can galaxy-ng be installed in Openshift?