ansible / galaxy_collection

Collection of modules and roles to configure Automation Hub
GNU General Public License v3.0
58 stars 54 forks source link

Role ee_repository is failing with HTTP Error 308: Permanent Redirect #191

Closed polatsinan closed 1 year ago

polatsinan commented 1 year ago

Summary

When using the ee_repository role, the task "Create EE Repository | Wait for finish the ee_repository creation" is failing with HTTP Error 308: Permanent Redirect

Issue Type

Ansible, Collection, Private Automation Hub details

ansible [core 2.14.0]
  config file = /opt/ansible-automation-platform/aap/ansible.cfg
  configured module search path = ['/home/polatsinan/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /home/polatsinan/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.9.13 (main, Jun 15 2022, 11:24:50) [GCC 8.5.0 20210514 (Red Hat 8.5.0-13)] (/usr/bin/python3.9)
  jinja version = 3.1.2
  libyaml = True

Collection                          Version
----------------------------------- -------
ansible.controller                  4.3.0
redhat_cop.ah_configuration         1.0.0
redhat_cop.controller_configuration 2.2.4

Private Automation Hub version
4.6.2

OS / ENVIRONMENT

RHEL 8, AH 4.6.2, Pulp Ansible 0.15.0

Desired Behavior

Successfully run task ee_repository creation

Actual Behavior

"msg": "GET error: Unexpected return code when calling https://<ah_url>/pulp/api/v3/distributions/container/container/?name=ansible-automation-platform-23%2Fee-29-rhel8: HTTP Error 308: Permanent Redirect"
TASK [redhat_cop.ah_configuration.ee_repository : Create EE Repository | Wait for finish the ee_repository creation] *************
failed: [localhost] (item={'failed': 0, 'started': 1, 'finished': 0, 'ansible_job_id': '307934242833.3727966', 'results_file': '/tmp/.ansible_async/307934242833.3727966', 'changed': False, '__ee_repository_item': {'name': 'ansible-automation-platform-23/ee-29-rhel8', 'upstream_name': 'ansible-automation-platform-23/ee-29-rhel8', 'registry': 'registry.redhat.io', 'exclude_tags': ['*-source']}, 'ansible_loop_var': '__ee_repository_item'}) => {"__ee_repositories_job_async_result_item": {"__ee_repository_item": {"exclude_tags": ["*-source"], "name": "ansible-automation-platform-23/ee-29-rhel8", "registry": "registry.redhat.io", "upstream_name": "ansible-automation-platform-23/ee-29-rhel8"}, "ansible_job_id": "307934242833.3727966", "ansible_loop_var": "__ee_repository_item", "changed": false, "failed": 0, "finished": 0, "results_file": "/tmp/.ansible_async/307934242833.3727966", "started": 1}, "ansible_job_id": "307934242833.3727966", "ansible_loop_var": "__ee_repositories_job_async_result_item", "attempts": 1, "changed": false, "finished": 1, "msg": "GET error: Unexpected return code when calling https://<ah_url>/pulp/api/v3/distributions/container/container/?name=ansible-automation-platform-23%2Fee-29-rhel8: HTTP Error 308: Permanent Redirect", "results_file": "/tmp/.ansible_async/307934242833.3727966", "started": 1, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

STEPS TO REPRODUCE

Vars:

ah_ee_repositories:
  - name: 'ansible-automation-platform-23/ee-29-rhel8'
    upstream_name: 'ansible-automation-platform-23/ee-29-rhel8'
    registry: 'registry.redhat.io'
    exclude_tags:
      - '*-source'
  - name: 'ansible-automation-platform-23/ee-minimal-rhel8'
    upstream_name: 'ansible-automation-platform-23/ee-minimal-rhel8'
    registry: 'registry.redhat.io'
    exclude_tags:
      - '*-source'
  - name: 'ansible-automation-platform-23/ee-supported-rhel8'
    upstream_name: 'ansible-automation-platform-23/ee-supported-rhel8'
    registry: 'registry.redhat.io'
    exclude_tags:
      - '*-source'
  - name: 'ansible-automation-platform-23/ansible-builder-rhel8'
    upstream_name: 'ansible-automation-platform-23/ansible-builder-rhel8'
    registry: 'registry.redhat.io'
    exclude_tags:
      - '*-source'
  - name: 'ansible-automation-platform/ee-minimal-rhel8'
    upstream_name: 'ansible-automation-platform/ee-minimal-rhel8'
    registry: 'registry.redhat.io'
    exclude_tags:
      - '*-source'
      - 'latest'

Run the following playbook:

- name: 'Hub Configuration'
  hosts: localhost
  connection: local
  gather_facts: false

  roles:
    - {role: redhat_cop.ah_configuration.ee_repository}

When doing a manual curl against AH https://<ah_url>/pulp/api/v3/distributions/container/container/?name=ansible-automation-platform-23%2Fee-29-rhel8 I am getting: HTTP Error 308: Permanent Redirect

Perhaps the pulp api has changed with the latest version?

polatsinan commented 1 year ago

Fixed with https://github.com/redhat-cop/ah_configuration/pull/192