Project

Profile

Help

Issue #7686

closed

requirements.yml is not compatible with ansible-galaxy

Added by fao89 over 3 years ago. Updated over 3 years 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 fileCLOSED - DUPLICATEActions
Has duplicate Ansible Plugin - Issue #7711: pulp_ansible could not determine API version for url with 'api/v2' appendedCLOSED - DUPLICATEActions
Actions #1

Updated by fao89 over 3 years ago

  • Description updated (diff)
Actions #3

Updated by newswangerd over 3 years 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
Actions #4

Updated by bmbouter over 3 years ago

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

Updated by bmbouter over 3 years 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.

Actions #6

Updated by daviddavis over 3 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to daviddavis
Actions #7

Updated by daviddavis over 3 years 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

Actions #8

Updated by daviddavis over 3 years ago

  • Sprint set to Sprint 84
Actions #9

Updated by daviddavis over 3 years ago

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

Updated by daviddavis over 3 years ago

  • Sprint/Milestone set to 0.5.0
Actions #11

Updated by pulpbot over 3 years ago

  • Status changed from ASSIGNED to POST

Added by daviddavis over 3 years ago

Revision 63b47551 | View on GitHub

Changing format for api urls

fixes #7686

Actions #12

Updated by daviddavis over 3 years ago

  • Status changed from POST to MODIFIED
Actions #13

Updated by pulpbot over 3 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF