Project

Profile

Help

Issue #7686

requirements.yml is not compatible with ansible-galaxy

Added by fao89 12 months ago. Updated 11 months ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 84
Quarter:

Description

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

Notes:

  • Include field at Validation Error messages
  • remote URL should be API root

Related issues

Related to Ansible Plugin - Issue #7734: Validate the requirements.yml fileNEW<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Has duplicate Ansible Plugin - Issue #7711: pulp_ansible could not determine API version for url with 'api/v2' appendedCLOSED - DUPLICATE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision 63b47551 View on GitHub
Added by daviddavis 11 months ago

Changing format for api urls

fixes #7686

History

#1 Updated by fao89 12 months ago

  • Description updated (diff)

#3 Updated by newswangerd 11 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

#4 Updated by bmbouter 11 months ago

  • Has duplicate Issue #7711: pulp_ansible could not determine API version for url with 'api/v2' appended added

#5 Updated by bmbouter 11 months ago

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:

  1. One that uses the requirements file from comment #3 as the requirements file
  2. One that uses a url like https://galaxy.ansible.com (the new style)
  3. 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.

#6 Updated by daviddavis 11 months ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to daviddavis

#7 Updated by daviddavis 11 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

https://github.com/ansible/ansible/blob/c20329a0f635611eb5300d633300b621b5d1fbf8/lib/ansible/cli/galaxy.py#L539-L544

Noticed that the ansible-galaxy cli will try to append 'api' to the end of the URL as well:

https://github.com/ansible/ansible/blob/c20329a0f635611eb5300d633300b621b5d1fbf8/lib/ansible/galaxy/api.py#L51-L52

#8 Updated by daviddavis 11 months ago

  • Sprint set to Sprint 84

#9 Updated by daviddavis 11 months ago

  • Related to Issue #7734: Validate the requirements.yml file added

#10 Updated by daviddavis 11 months ago

  • Sprint/Milestone set to 0.5.0

#11 Updated by pulpbot 11 months ago

  • Status changed from ASSIGNED to POST

#12 Updated by daviddavis 11 months ago

  • Status changed from POST to MODIFIED

#13 Updated by pulpbot 11 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF