I’m working with a semi-air-gapped installation of Galaxy_NG:4.8.1, and have automated a process of downloading collection tars from galaxy.ansible.com and uploading them to the private hub’s community repository. The redhat certified/validated content repositories are not blocked by firewall, so those are synced directly, while the community repository remote source is blocked. The current list of collections I’m “manually syncing” from the community repository are based on https://github.com/ansible-community/ansible-build-data/tree/main/7/galaxy-equirements.yml, but I run into errors when trying to upload artifacts that already exist in rh-certified (such as the ansible.* collections).
There is a process in the UI to copy collections between repositories.
- Log in to hub
- Navigate to Collections → Repositories
- Locate your destination repository and click the [More Actions] icon (3 vertical dots); then select Edit
- Select the Collections version tab.
- Click [Add Collection] and select the collections that you want to add to the repository.
- Click [Select].
I would like to ensure all of the collections I require from the community upstream is synced to the local community repository, even if the artifact is already in another repository. While I could manually do this in the UI, that’s very tedious. Is there a way to automate the “Add Collection” function through the API? I’m having a hard time finding this specific function in the swagger-ui, but I feel like it may be because the api path is counter-intuitive to the UI’s process.