requirements.yml is not compatible with ansible-galaxy
source should not require /v(d)/collections endpoint from: https://github.com/ansible/ansible/blob/devel/lib/ansible/cli/galaxy.py#L522-L549
source: the URL or a predefined source name that relates to C.GALAXY_SERVER_LIST
- Include field at Validation Error messages
- remote URL should be API root
#3 Updated by newswangerd 6 months ago
Here's a sample requirements.yml that should work
collections: - name: amazon.aws source: https://galaxy.ansible.com version: 1.2.1 - name: junipernetworks.junos source: https://galaxy.ansible.com - name: f5networks.f5_modules source: https://galaxy.ansible.com
Here's what I think needs to be done for this ticket:
From a high level we need to accept data just like the CLI does: https://docs.ansible.com/ansible/latest/user_guide/collections_using.html#configuring-the-ansible-galaxy-client
To do that effectively we need to accept remote.url and remote.requirements_file differently.
I think tests would make developing this easier, so I suggest make or update some tests:
- One that uses the requirements file from comment #3 as the requirements file
- One that uses a url like
https://galaxy.ansible.com(the new style)
- One that uses a url like we used to use
https://galaxy.ansible.com/api/v2/collections/and ensure it's rejected
In terms of migrations, maybe we need a migration? I don't think we should support the old-style data, but maybe refuse to sync with it if it's present and not ship a migration ... ?
I think the sync machinery is what needs to be updated. I think doing this only for CollectionRemote is ok, RoleRemote can continue to be whatever it is unless it's easier to also update that one.
#7 Updated by daviddavis 6 months ago
We don't support requirements files for RoleRemote. That field is only on CollectionRemotes.
For the requirements file, we need to support two formats for collections: name.collection and a dict with name/version/source/etc
Noticed that the ansible-galaxy cli will try to append 'api' to the end of the URL as well:
#12 Updated by daviddavis 6 months ago
- Status changed from POST to MODIFIED
Applied in changeset pulp_ansible|63b475516b7927e650a71ab03ba81b47baff3b93.
Please register to edit this issue