Project

Profile

Help

Issue #5155

Ansible Collection Is Installed With Wrong Version

Added by ompragash over 1 year ago. Updated over 1 year ago.

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

Description

OS / ENVIRONMENT

- Fedora release 30 (Thirty)
- Ansible == 2.8.1
- pulpcore == 3.0.0rc3
- pulpcore-plugin == 0.1.0rc3
- pulp_ansible == 0.2.0b1

STEPS TO REPRODUCE

- Deploy pulp_ansible

- Create a Repo, Sync/Upload Ansible collection

- Publish the uploaded Collection

- In my case I have uploaded three different collection each with different version as you can see below:

testing.ansible_testing_content,4.0.6
ompragash.collections,1.0.12
greetings_namespace.hello,11.11.11

- Also uploaded collection_list.txt which has the API output of `/pulp/api/v3/content/ansible/collections/` endpoint.

- Install mazer and configure ~/.ansible/mazer.yml file

server:
ignore_certs: false
url: http://localhost:24817/pulp_ansible/galaxy/galaxy_base

- Now run `mazer install NAMESPACE_name.COLLECTION_name` to install uploaded collections from pulp_ansible

EXPECTED RESULTS

- Collection should be installed and if no version is specified `mazer` should install the latest available version and if version is specified it should install the required version.

ACTUAL RESULTS

- Collection is installed with the wrong version i.e. with the version of another collection

- As you can see I have three collections and when I try to install `ompragash.collections` or `greetings_namespace.hello` it is always installed with version 4.0.6.

Observations:

- Trying to install an collection with the specific version but got the below error:

~~~
[ ~]# mazer install ompragash.collections,1.0.12

Collection specs to install:
ompragash.collections,==1.0.12

Installing spec: ompragash.collections,==1.0.12
Unable to find a collection that matches the spec: ompragash.collections,==1.0.12:
- you can use --ignore-errors to skip failed collections and finish processing the list.
~~~

- When I only call the collection name like below:

~~~
[ ~]# mazer install ompragash.collections

Collection specs to install:
ompragash.collections,*

Installing spec: ompragash.collections,*
Found: ompragash.collections,4.0.6 (for spec ompragash.collections,*)
Installed: ompragash.collections,4.0.6 (to /root/.ansible/collections/ansible_collections/ompragash/collections)
~~~

here^ if you see `ompragash.collections` is installed with version 4.0.6 which is the version of another collection (i.e. testing.ansible_testing_content)

collection_list.txt (3.06 KB) collection_list.txt ompragash, 07/18/2019 07:08 PM

History

#1 Updated by daviddavis over 1 year ago

I was able to verify this behavior with just httpie:

$ http :24817/pulp_ansible/galaxy/dev/api/v2/collections/ompragash/collections/versions/
HTTP/1.1 200 OK
Allow: GET, HEAD, OPTIONS
Connection: close
Content-Length: 374
Content-Type: application/json
Date: Wed, 17 Jul 2019 20:12:39 GMT
Server: gunicorn/19.9.0
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN

{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "href": "http://localhost:24817/pulp_ansible/galaxy/dev/api/v2/collections/testing/ansible_testing_content/versions/4.0.6/",
            "name": "ansible_testing_content",
            "namespace": "testing",
            "version": "4.0.6",
            "versions_url": "http://localhost:24817/pulp_ansible/galaxy/dev/api/v2/collections/testing/ansible_testing_content/versions/"
        }
    ]
}

#2 Updated by daviddavis over 1 year ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 56

#3 Updated by bmbouter over 1 year ago

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

#4 Updated by bmbouter over 1 year ago

I wasn't able to reproduce this against the latest master. I tested against the commits below.

pulp_ansible: 3c3eb5d5dc32a14af739bfe7d6baca89538f71f7
pulpcore: 67045132cf5b86623884cbcb313e9a008a592f8e
pulpcore-plugin: f7f67bd669a4d135c38c7f8e9a2f2af8dee65f5d

I created the 3 mazer built test fixtures:

(pulp) [vagrant@pulp3-source-fedora29 devel]$ ls *.tar.gz
greetings_namespace-hello-11.11.11.tar.gz     ompragash-collections-1.0.12.tar.gz        testing-ansible_testing_content-4.0.6.tar.gz

I uploaded them and they can be listed:

(pulp) [vagrant@pulp3-source-fedora29 devel]$ http :24817/pulp/api/v3/content/ansible/collections/
HTTP/1.1 200 OK
Allow: GET, POST, HEAD, OPTIONS
Connection: close
Content-Length: 2439
Content-Type: application/json
Date: Fri, 26 Jul 2019 22:36:21 GMT
Server: gunicorn/19.9.0
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN

{
    "count": 3,
    "next": null,
    "previous": null,
    "results": [
        {
            "_artifact": "/pulp/api/v3/artifacts/d055b483-3d4c-44bc-abd3-8b486812155d/",
            "_created": "2019-07-26T22:02:04.041623Z",
            "_href": "/pulp/api/v3/content/ansible/collections/cb850b5a-2fa6-4446-9f02-1670b2ea1e3b/",
            "_type": "ansible.collection_version",
            "md5": "1e165e10386b3f88baca04784ffcad45",
            "name": "ansible_testing_content",
            "namespace": "testing",
            "sha1": "a06d826da2740c664588ffe33347558fa98094b9",
            "sha224": "769636331ebf9533fb7d829af07db084243a60f3c0b4ac6464898ece",
            "sha256": "bcf325ccae6c516a651d047218bd5ba52f6b8ecd7a02ab1925b459fb35689374",
            "sha384": "e880c51f5020f5fbe94ec04a058bc1297284ebb0343f9cf8aaa13f708103222f60a6ef059f22d5601d047b714c0f5861",
            "sha512": "00350c0ff30fa6e347c4608d7757e262ed1ed905cfb98ca54394a53da215f36d8c0e92b64946ccbf3136e7eb6ad16fb5356237d53946b45a62dcad9297e6370f",
            "version": "4.0.6"
        },
        {
            "_artifact": "/pulp/api/v3/artifacts/e4e4b603-2cdd-48e6-a367-95acd25ff472/",
            "_created": "2019-07-26T22:02:04.524893Z",
            "_href": "/pulp/api/v3/content/ansible/collections/4d90f5df-9d07-4e27-aecf-7eb2fdc8f255/",
            "_type": "ansible.collection_version",
            "md5": "7ebedcaf0e3c3576d6e86e0dd7f876b8",
            "name": "collections",
            "namespace": "ompragash",
            "sha1": "d9d645eb2e9016b50a95df982aea7b182a29f788",
            "sha224": "61ac9e062ef9d0de26803e81b4956a30be6601a533b307d886b84b8c",
            "sha256": "d9d03e1be63084b0f407f5c39d89bd093c4613745708e4bf9f3042178d226082",
            "sha384": "955fb32c0c53155ce21921cef9157389c63040721fd7dcd72c0b69c92690fbcf2d9f085a65fd9dcb753969959cd1a1cd",
            "sha512": "3e5fd5dc3216c9236004f41578afae8dc356a6051e7a593a1b4b350e6d8a14c9b36eaaf171d80524df3334bbe0372f3c2163bc4172b51e292f71a555b98593b8",
            "version": "1.0.12"
        },
        {
            "_artifact": "/pulp/api/v3/artifacts/948c96f0-2825-420c-9c5c-9e5c29b4cd51/",
            "_created": "2019-07-26T22:02:05.638450Z",
            "_href": "/pulp/api/v3/content/ansible/collections/e6762b3e-d8bf-427c-a5cb-552cad459350/",
            "_type": "ansible.collection_version",
            "md5": "c341ee2ee791b88a585b875ead186a8c",
            "name": "hello",
            "namespace": "greetings_namespace",
            "sha1": "9a10c3a56ac41281361fc683392485c495bca3b2",
            "sha224": "b214ed31fe1087d994af904073c2b14a5ec3ed38e9ca655696d0e40c",
            "sha256": "abd95aa747ff51d69dd0de880fd170c1f8296caccb9f628405694be080f4f0d8",
            "sha384": "1360c7e7fc68baf0dc67cde0e37d46ea3b1374a5d2f03aebf3fe6ce70bfa7184538161384a034380544c31ce153241e7",
            "sha512": "186996e6198413ae440cd15bbafe873bc76df73e15d40a3e1a2a55db234b08bee80199a3409d8df5c43677f2e09f00d3e1a91e46d71cfc6838ee997444346b36",
            "version": "11.11.11"
        }
    ]
}

The http responded with the correct version for me:

(pulp) [vagrant@pulp3-source-fedora29 .ansible]$ http :24817/pulp_ansible/galaxy/dev/api/v2/collections/ompragash/collections/versions/
HTTP/1.1 200 OK
Allow: GET, HEAD, OPTIONS
Connection: close
Content-Length: 346
Content-Type: application/json
Date: Fri, 26 Jul 2019 22:33:07 GMT
Server: gunicorn/19.9.0
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN

{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "href": "http://localhost:24817/pulp_ansible/galaxy/dev/api/v2/collections/ompragash/collections/versions/1.0.12/",
            "name": "collections",
            "namespace": "ompragash",
            "version": "1.0.12",
            "versions_url": "http://localhost:24817/pulp_ansible/galaxy/dev/api/v2/collections/ompragash/collections/versions/"
        }
    ]
}

The install works as expected for me:

(pulp) [vagrant@pulp3-source-fedora29 .ansible]$ mazer install ompragash.collections

Collection specs to install:
  ompragash.collections,*

Installing spec: ompragash.collections,*
  Found: ompragash.collections,1.0.12 (for spec ompragash.collections,*)
  Installed: ompragash.collections,1.0.12 (to /home/vagrant/.ansible/collections/ansible_collections/ompragash/collections)

#5 Updated by bmbouter over 1 year ago

  • Status changed from ASSIGNED to CLOSED - WORKSFORME

@ompragash I'm going to close this as WORKSFORME. I think what may have explained it was it was present in RC3, but I think the recent modelling changes in source could have fixed it.

Please reopen or comment if you experience this on a newer installation RC4 for example.

Please register to edit this issue

Also available in: Atom PDF