Uploaded image for project: 'Automation Hub'
  1. Automation Hub
  2. AAH-1386

Forbidden message via ansible-galaxy collection install

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • crc-2022-09-07
    • 2.1.1
    • Backend, QE
    • None
    • False
    • False
    • None

      The following options are set and I can download collections via UI without a login.

      GALAXY_ENABLE_UNAUTHENTICATED_COLLECTION_ACCESS = True
      GALAXY_ENABLE_UNAUTHENTICATED_COLLECTION_DOWNLOAD = True

      However, when attempting to install via ansible-galaxy, I get this message:

      ansible-galaxy collection install -s https://my-galaxy-sandbox.com/api/galaxy/content/published/ lmt.ac_galaxy_demo -vvv
      ansible-galaxy 2.10.17
        config file = /etc/ansible/ansible.cfg
        configured module search path = ['/home/xxx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
        ansible python module location = /home/xxx/.local/lib/python3.8/site-packages/ansible
        executable location = /home/xxx/.local/bin/ansible-galaxy
        python version = 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]
      Using /etc/ansible/ansible.cfg as config file
      Starting galaxy collection install process
      Process install dependency map
      Opened /home/xxx/.ansible/galaxy_token
      Processing requirement collection 'lmt.ac_galaxy_demo'
      ERROR! Error when finding available api versions from cmd_arg (https://my-galaxy-sandbox.com/api/galaxy/content/published/) (HTTP Code: 403, Message: Forbidden)

       

      I am able to install if I provide a token, but I think I should be able to install without login as I can download in UI.

      ansible-galaxy collection install -s https://my-galaxy-sandbox.com/api/galaxy/content/published/ --token 7277e4b4cdd31f7fcff3399daea3aec06ab378d9 lmt.ac_galaxy_demo -vvv
      ansible-galaxy 2.10.17
        config file = /etc/ansible/ansible.cfg
        configured module search path = ['/home/xxx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
        ansible python module location = /home/xxx/.local/lib/python3.8/site-packages/ansible
        executable location = /home/xxx/.local/bin/ansible-galaxy
        python version = 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]
      Using /etc/ansible/ansible.cfg as config file
      Starting galaxy collection install process
      Process install dependency map
      Opened /home/xxx/.ansible/galaxy_token
      Processing requirement collection 'lmt.ac_galaxy_demo'
      Collection 'lmt.ac_galaxy_demo' obtained from server cmd_arg https://my-galaxy-sandbox.com/api/galaxy/content/published/
      Starting collection install process
      Installing 'lmt.ac_galaxy_demo:1.0.0' to '/home/xxx/.ansible/collections/ansible_collections/lmt/ac_galaxy_demo'
      Downloading https://my-galaxy-sandbox.com/api/galaxy/v3/artifacts/collections/published/lmt-ac_galaxy_demo-1.0.0.tar.gz to /home/xxx/.ansible/tmp/ansible-local-325184907a_n21/tmp8zh0f7rv
      lmt.ac_galaxy_demo (1.0.0) was installed successfully

       

      Installed versions:

      pulpcore==3.15.1
      galaxy-ng==4.4.1
      pulp-ansible==0.10.1
      pulp-container==2.8.3

              Unassigned Unassigned
              stewardb Beth Steward (Inactive)
              Archiver:
              ranumula@redhat.com Raju Anumula

                Created:
                Updated:
                Resolved:
                Archived: