redhat-cop / aap_utilities

Ansible Collection for automated deployment of AAP and other objects for general use
https://galaxy.ansible.com/infra/aap_utilities
GNU General Public License v3.0
74 stars 44 forks source link

aap_setup_download role has errors with AAP 2.3 #161

Closed philthynz closed 1 year ago

philthynz commented 1 year ago

Summary

Using this role with it's defaults to download 2.3 of AAP errors on task "Extract the name of the downloaded installer to aap_setup_down_installer_file".

The role works when I specify aap_base_version: 2.2

Issue Type

Ansible, Collection, Docker/Podman details

ansible --version

ansible [core 2.13.6]
  config file = None
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/user/python-venv/ansible2.13/lib/python3.8/site-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/user/python-venv/ansible2.13/bin/ansible
  python version = 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True

ansible-galaxy collection list

Collection                    Version
----------------------------- -------
amazon.aws                    3.5.0
ansible.netcommon             3.1.3
ansible.posix                 1.4.0
ansible.utils                 2.7.0
ansible.windows               1.12.0
arista.eos                    5.0.1
awx.awx                       21.8.0
azure.azcollection            1.14.0
check_point.mgmt              2.3.0
chocolatey.chocolatey         1.3.1
cisco.aci                     2.3.0
cisco.asa                     3.1.0
cisco.dnac                    6.6.0
cisco.intersight              1.0.20
cisco.ios                     3.3.2
cisco.iosxr                   3.3.1
cisco.ise                     2.5.8
cisco.meraki                  2.11.0
cisco.mso                     2.1.0
cisco.nso                     1.0.3
cisco.nxos                    3.2.0
cisco.ucs                     1.8.0
cloud.common                  2.1.2
cloudscale_ch.cloud           2.2.2
community.aws                 3.6.0
community.azure               1.1.0
community.ciscosmb            1.0.5
community.crypto              2.8.1
community.digitalocean        1.22.0
community.dns                 2.4.0
community.docker              2.7.1
community.fortios             1.0.0
community.general             5.8.0
community.google              1.0.0
community.grafana             1.5.3
community.hashi_vault         3.4.0
community.hrobot              1.6.0
community.libvirt             1.2.0
community.mongodb             1.4.2
community.mysql               3.5.1
community.network             4.0.1
community.okd                 2.2.0
community.postgresql          2.3.0
community.proxysql            1.4.0
community.rabbitmq            1.2.3
community.routeros            2.3.1
community.sap                 1.0.0
community.sap_libs            1.3.0
community.skydive             1.0.0
community.sops                1.4.1
community.vmware              2.10.1
community.windows             1.11.1
community.zabbix              1.8.0
containers.podman             1.9.4
cyberark.conjur               1.2.0
cyberark.pas                  1.0.14
dellemc.enterprise_sonic      1.1.2
dellemc.openmanage            5.5.0
dellemc.os10                  1.1.1
dellemc.os6                   1.0.7
dellemc.os9                   1.0.4
f5networks.f5_modules         1.20.0
fortinet.fortimanager         2.1.6
fortinet.fortios              2.1.7
frr.frr                       2.0.0
gluster.gluster               1.0.2
google.cloud                  1.0.2
hetzner.hcloud                1.8.2
hpe.nimble                    1.1.4
ibm.qradar                    2.1.0
ibm.spectrum_virtualize       1.10.0
infinidat.infinibox           1.3.7
infoblox.nios_modules         1.4.0
inspur.ispim                  1.2.0
inspur.sm                     2.3.0
junipernetworks.junos         3.1.0
kubernetes.core               2.3.2
lowlydba.sqlserver            1.0.4
mellanox.onyx                 1.0.0
netapp.aws                    21.7.0
netapp.azure                  21.10.0
netapp.cloudmanager           21.21.0
netapp.elementsw              21.7.0
netapp.ontap                  21.24.1
netapp.storagegrid            21.11.1
netapp.um_info                21.8.0
netapp_eseries.santricity     1.3.1
netbox.netbox                 3.8.1
ngine_io.cloudstack           2.2.4
ngine_io.exoscale             1.0.0
ngine_io.vultr                1.1.2
openstack.cloud               1.10.0
openvswitch.openvswitch       2.1.0
ovirt.ovirt                   2.3.1
purestorage.flasharray        1.14.0
purestorage.flashblade        1.10.0
purestorage.fusion            1.1.1
sensu.sensu_go                1.13.1
servicenow.servicenow         1.0.6
splunk.es                     2.1.0
t_systems_mms.icinga_director 1.31.4
theforeman.foreman            3.7.0
vmware.vmware_rest            2.2.0
vultr.cloud                   1.3.0
vyos.vyos                     3.0.1
wti.remote                    1.0.4

OS / ENVIRONMENT

WSL Ubuntu 20.04

Desired Behavior

Package downloads

Actual Behavior

Package does not download

Console log

TASK [infra.aap_utilities.aap_setup_download : Login to Red Hat APIs] *******************************************************************************************************************************************task path: /home/user/.ansible/collections/ansible_collections/infra/aap_utilities/roles/aap_setup_download/tasks/main.yml:3
ok: [localhost] => {"cache_control": "no-store", "changed": false, "connection": "close", "content_length": "2843", "content_type": "application/json", "cookies": {"2a4bcc483fa585dc0ad94b51550d0923": "29cfadb8e39357a26336465455f54321"}, "cookies_string": "2a4bcc483fa585dc0ad94b51550d0923=29cfadb8e39357a26336465455f54321", "date": "Tue, 02 May 2023 23:01:19 GMT", "elapsed": 0, "json": {"access_token": "<token>", "expires_in": 900, "not-before-policy": 0, "refresh_expires_in": 0, "refresh_token": "<token>", "scope": "offline_access", "session_state": "bea77889-8ee7-4651-87e1-3d72e52b8cba", "token_type": "Bearer"}, "keep_alive": "timeout=300", "msg": "OK (2843 bytes)", "pragma": "no-cache", "redirected": false, "referrer_policy": "strict-origin", "set_cookie": "2a4bcc483fa585dc0ad94b51550d0923=29cfadb8e39357a26336465455f54321; path=/; HttpOnly; Secure; SameSite=None", "status": 200, "strict_transport_security": "max-age=31536000; includeSubDomains", "url": "https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token", "x_content_type_options": "nosniff", "x_frame_options": "SAMEORIGIN", "x_rh_edge_cache_status": "Miss from child, Miss from parent", "x_rh_edge_reference_id": "0.8da96068.1683068479.2ba44f7c", "x_rh_edge_request_id": "2ba44f7c", "x_site": "prod-spoke-aws-us-east-1", "x_xss_protection": "1; mode=block"}

TASK [infra.aap_utilities.aap_setup_download : Collecting the available installers] *****************************************************************************************************************************task path: /home/user/.ansible/collections/ansible_collections/infra/aap_utilities/roles/aap_setup_download/tasks/main.yml:14
ok: [localhost] => {"cache_control": "no-cache, no-store, max-age=0, must-revalidate", "changed": false, "connection": "close", "content": "{\"pagination\":{\"offset\":0,\"limit\":25,\"count\":5},\"body\":[{\"imageName\":\"Ansible Automation Platform 2.3 Setup\",\"filename\":\"ansible-automation-platform-setup-2.3-2.tar.gz\",\"arch\":\"x86_64\",\"datePublished\":\"2023-03-16T13:00:52.000Z\",\"checksum\":\"879e97e4c63de3727657284eb05a3a9e9897c66bd5059183d804d20f579c75a0\",\"downloadHref\":\"https://api.access.redhat.com/management/v1/images/879e97e4c63de3727657284eb05a3a9e9897c66bd5059183d804d20f579c75a0/download\"},{\"imageName\":\"Ansible Automation Platform 2.3 Setup Bundle\",\"filename\":\"ansible-automation-platform-setup-bundle-2.3-2.1.tar.gz\",\"arch\":\"x86_64\",\"datePublished\":\"2023-04-20T18:56:00.000Z\",\"checksum\":\"7456b98f2f50e0e1d4c93fb4e375fe8a9174f397a5b1c0950915224f7f020ec4\",\"downloadHref\":\"https://api.access.redhat.com/management/v1/images/7456b98f2f50e0e1d4c93fb4e375fe8a9174f397a5b1c0950915224f7f020ec4/download\"},{\"imageName\":\"Ansible Rulebook 0.9.4 (Dev Preview - Source Only)\",\"filename\":\"ansible-rulebook-0.9.4.tar.gz\",\"arch\":\"x86_64\",\"datePublished\":\"2022-12-13T17:08:53.000Z\",\"checksum\":\"9c75400190475a0beced9f8319123e9725b84a295f0fc8b2b2d03f8d83cb4469\",\"downloadHref\":\"https://api.access.redhat.com/management/v1/images/9c75400190475a0beced9f8319123e9725b84a295f0fc8b2b2d03f8d83cb4469/download\"},{\"imageName\":\"Ansible Validated Content\",\"filename\":\"ansible-validated-content-bundle-1.1.tar.gz\",\"arch\":\"x86_64\",\"datePublished\":\"2023-04-04T15:59:28.000Z\",\"checksum\":\"c0d2eb18e7a87c77f5660b41ce8dc85e5e64841e95986a553ae90edecdc30f0c\",\"downloadHref\":\"https://api.access.redhat.com/management/v1/images/c0d2eb18e7a87c77f5660b41ce8dc85e5e64841e95986a553ae90edecdc30f0c/download\"},{\"imageName\":\"Event Driven Automation 0.1.0 (Dev Preview - Source Only)\",\"filename\":\"eda-server-0.1.0.tar.gz\",\"arch\":\"x86_64\",\"datePublished\":\"2022-12-13T17:24:08.000Z\",\"checksum\":\"a414482ab3cce6d2f6932daff4362cb5bfe18271425d3c16217020886fb0d02c\",\"downloadHref\":\"https://api.access.redhat.com/management/v1/images/a414482ab3cce6d2f6932daff4362cb5bfe18271425d3c16217020886fb0d02c/download\"}]}", "content_length": "2016", "content_type": "application/json", "cookies": {"1a500012c7bab34b642b199769f73ca5": "c46dc096f21026f274a601be1a7565e3"}, "cookies_string": "1a500012c7bab34b642b199769f73ca5=c46dc096f21026f274a601be1a7565e3", "date": "Tue, 02 May 2023 23:01:21 GMT", "elapsed": 1, "expires": "0", "json": {"body": [{"arch": "x86_64", "checksum": "879e97e4c63de3727657284eb05a3a9e9897c66bd5059183d804d20f579c75a0", "datePublished": "2023-03-16T13:00:52.000Z", "downloadHref": "https://api.access.redhat.com/management/v1/images/879e97e4c63de3727657284eb05a3a9e9897c66bd5059183d804d20f579c75a0/download", "filename": "ansible-automation-platform-setup-2.3-2.tar.gz", "imageName": "Ansible Automation Platform 2.3 Setup"}, {"arch": "x86_64", "checksum": "7456b98f2f50e0e1d4c93fb4e375fe8a9174f397a5b1c0950915224f7f020ec4", "datePublished": "2023-04-20T18:56:00.000Z", "downloadHref": "https://api.access.redhat.com/management/v1/images/7456b98f2f50e0e1d4c93fb4e375fe8a9174f397a5b1c0950915224f7f020ec4/download", "filename": "ansible-automation-platform-setup-bundle-2.3-2.1.tar.gz", "imageName": "Ansible Automation Platform 2.3 Setup Bundle"}, {"arch": "x86_64", "checksum": "9c75400190475a0beced9f8319123e9725b84a295f0fc8b2b2d03f8d83cb4469", "datePublished": "2022-12-13T17:08:53.000Z", "downloadHref": "https://api.access.redhat.com/management/v1/images/9c75400190475a0beced9f8319123e9725b84a295f0fc8b2b2d03f8d83cb4469/download", "filename": "ansible-rulebook-0.9.4.tar.gz", "imageName": "Ansible Rulebook 0.9.4 (Dev Preview - Source Only)"}, {"arch": "x86_64", "checksum": "c0d2eb18e7a87c77f5660b41ce8dc85e5e64841e95986a553ae90edecdc30f0c", "datePublished": "2023-04-04T15:59:28.000Z", "downloadHref": "https://api.access.redhat.com/management/v1/images/c0d2eb18e7a87c77f5660b41ce8dc85e5e64841e95986a553ae90edecdc30f0c/download", "filename": "ansible-validated-content-bundle-1.1.tar.gz", "imageName": "Ansible Validated Content"}, {"arch": "x86_64", "checksum": "a414482ab3cce6d2f6932daff4362cb5bfe18271425d3c16217020886fb0d02c", "datePublished": "2022-12-13T17:24:08.000Z", "downloadHref": 
"https://api.access.redhat.com/management/v1/images/a414482ab3cce6d2f6932daff4362cb5bfe18271425d3c16217020886fb0d02c/download", "filename": "eda-server-0.1.0.tar.gz", "imageName": "Event Driven Automation 0.1.0 (Dev Preview - Source Only)"}], "pagination": {"count": 5, "limit": 25, "offset": 0}}, "msg": "OK (2016 bytes)", "pragma": "no-cache", "redirected": false, "referrer_policy": "no-referrer", "set_cookie": "1a500012c7bab34b642b199769f73ca5=c46dc096f21026f274a601be1a7565e3; path=/; HttpOnly; Secure; SameSite=None", "status": 200, "strict_transport_security": "max-age=31536000 ; includeSubDomains", "traceparent": "00-c34091c1c4a26e674674c696cc68d80d-5c6fdee870cd3e1c-01", "url": "https://api.access.redhat.com/management/v1/images/cset/ansible-automation-platform-2.3-for-rhel-9-x86_64-files", "vary": "Origin", "x_content_type_options": "nosniff", "x_frame_options": "DENY", "x_xss_protection": "1 ; mode=block"}

TASK [infra.aap_utilities.aap_setup_download : Simplify the list of possible downloads] *************************************************************************************************************************task path: /home/user/.ansible/collections/ansible_collections/infra/aap_utilities/roles/aap_setup_download/tasks/main.yml:23
ok: [localhost] => {"ansible_facts": {"__aap_setup_down_images": [{"arch": "x86_64", "checksum": "7456b98f2f50e0e1d4c93fb4e375fe8a9174f397a5b1c0950915224f7f020ec4", "datePublished": "2023-04-20T18:56:00.000Z", "downloadHref": "https://api.access.redhat.com/management/v1/images/7456b98f2f50e0e1d4c93fb4e375fe8a9174f397a5b1c0950915224f7f020ec4/download", "filename": "ansible-automation-platform-setup-bundle-2.3-2.1.tar.gz", "imageName": "Ansible Automation Platform 2.3 Setup Bundle"}, {"arch": "x86_64", "checksum": "c0d2eb18e7a87c77f5660b41ce8dc85e5e64841e95986a553ae90edecdc30f0c", "datePublished": "2023-04-04T15:59:28.000Z", "downloadHref": "https://api.access.redhat.com/management/v1/images/c0d2eb18e7a87c77f5660b41ce8dc85e5e64841e95986a553ae90edecdc30f0c/download", "filename": "ansible-validated-content-bundle-1.1.tar.gz", "imageName": "Ansible Validated Content"}, {"arch": "x86_64", "checksum": "879e97e4c63de3727657284eb05a3a9e9897c66bd5059183d804d20f579c75a0", "datePublished": "2023-03-16T13:00:52.000Z", "downloadHref": "https://api.access.redhat.com/management/v1/images/879e97e4c63de3727657284eb05a3a9e9897c66bd5059183d804d20f579c75a0/download", "filename": "ansible-automation-platform-setup-2.3-2.tar.gz", "imageName": "Ansible Automation Platform 2.3 Setup"}, {"arch": "x86_64", "checksum": "a414482ab3cce6d2f6932daff4362cb5bfe18271425d3c16217020886fb0d02c", "datePublished": "2022-12-13T17:24:08.000Z", "downloadHref": "https://api.access.redhat.com/management/v1/images/a414482ab3cce6d2f6932daff4362cb5bfe18271425d3c16217020886fb0d02c/download", "filename": "eda-server-0.1.0.tar.gz", "imageName": "Event Driven Automation 0.1.0 (Dev Preview - Source Only)"}, {"arch": "x86_64", "checksum": "9c75400190475a0beced9f8319123e9725b84a295f0fc8b2b2d03f8d83cb4469", "datePublished": "2022-12-13T17:08:53.000Z", "downloadHref": "https://api.access.redhat.com/management/v1/images/9c75400190475a0beced9f8319123e9725b84a295f0fc8b2b2d03f8d83cb4469/download", "filename": "ansible-rulebook-0.9.4.tar.gz", "imageName": "Ansible Rulebook 0.9.4 (Dev Preview - Source Only)"}]}, "changed": false}

TASK [infra.aap_utilities.aap_setup_download : Downloading the latest installer of type setup] ******************************************************************************************************************task path: /home/user/.ansible/collections/ansible_collections/infra/aap_utilities/roles/aap_setup_download/tasks/main.yml:27
skipping: [localhost] => (item={'imageName': 'Ansible Automation Platform 2.3 Setup Bundle', 'filename': 'ansible-automation-platform-setup-bundle-2.3-2.1.tar.gz', 'arch': 'x86_64', 'datePublished': '2023-04-20T18:56:00.000Z', 'checksum': '7456b98f2f50e0e1d4c93fb4e375fe8a9174f397a5b1c0950915224f7f020ec4', 'downloadHref': 'https://api.access.redhat.com/management/v1/images/7456b98f2f50e0e1d4c93fb4e375fe8a9174f397a5b1c0950915224f7f020ec4/download'})  => {"ansible_loop_var": "item", "changed": false, "item": {"arch": "x86_64", "checksum": "7456b98f2f50e0e1d4c93fb4e375fe8a9174f397a5b1c0950915224f7f020ec4", "datePublished": 
"2023-04-20T18:56:00.000Z", "downloadHref": "https://api.access.redhat.com/management/v1/images/7456b98f2f50e0e1d4c93fb4e375fe8a9174f397a5b1c0950915224f7f020ec4/download", "filename": "ansible-automation-platform-setup-bundle-2.3-2.1.tar.gz", "imageName": "Ansible Automation Platform 2.3 Setup Bundle"}, "skip_reason": "Conditional result was False"}
skipping: [localhost] => (item={'imageName': 'Ansible Validated Content', 'filename': 'ansible-validated-content-bundle-1.1.tar.gz', 'arch': 'x86_64', 'datePublished': '2023-04-04T15:59:28.000Z', 'checksum': 'c0d2eb18e7a87c77f5660b41ce8dc85e5e64841e95986a553ae90edecdc30f0c', 'downloadHref': 'https://api.access.redhat.com/management/v1/images/c0d2eb18e7a87c77f5660b41ce8dc85e5e64841e95986a553ae90edecdc30f0c/download'})  => {"ansible_loop_var": "item", "changed": false, "item": {"arch": "x86_64", "checksum": "c0d2eb18e7a87c77f5660b41ce8dc85e5e64841e95986a553ae90edecdc30f0c", "datePublished": "2023-04-04T15:59:28.000Z", "downloadHref": "https://api.access.redhat.com/management/v1/images/c0d2eb18e7a87c77f5660b41ce8dc85e5e64841e95986a553ae90edecdc30f0c/download", "filename": "ansible-validated-content-bundle-1.1.tar.gz", "imageName": "Ansible Validated Content"}, "skip_reason": "Conditional result was False"}

TASK [infra.aap_utilities.aap_setup_download : Extract the name of the downloaded installer to aap_setup_down_installer_file] ***********************************************************************************task path: /home/user/.ansible/collections/ansible_collections/infra/aap_utilities/roles/aap_setup_download/tasks/main.yml:38
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: list object has no element 0\n\nThe error appears to be in '/home/user/.ansible/collections/ansible_collections/infra/aap_utilities/roles/aap_setup_download/tasks/main.yml': line 38, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Extract the name of the downloaded installer to aap_setup_down_installer_file\n  ^ here\n"}

STEPS TO REPRODUCE

Run playbook command on playbooks file

  tasks:
    - name: Install collections
      community.general.ansible_galaxy_install:
        type: collection
        name: infra.aap_utilities

    - name: Download Setup
      ansible.builtin.import_role:
        name: infra.aap_utilities.aap_setup_download
      vars:
        aap_setup_down_version: 2.3
        aap_setup_down_dest_dir: /var/tmp
        aap_setup_down_type: setup-bundle
        aap_setup_rhel_version: 9
djdanielsson commented 1 year ago

For fun try RHEL 8 please, I am curious if it's a bug with RHEL 9 variable.

philthynz commented 1 year ago

Hey @djdanielsson . Same issue unfortunatley

    - name: Download Setup
      ansible.builtin.import_role:
        name: infra.aap_utilities.aap_setup_download
      vars:
        aap_setup_down_version: 2.3
        aap_setup_down_dest_dir: ~/
        aap_setup_down_type: setup
        aap_setup_rhel_version: 8
TASK [infra.aap_utilities.aap_setup_download : Extract the name of the downloaded installer to aap_setup_down_installer_file] **************************************************************fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: list object has no element 0\n\nThe error appears to be in '/home/user/.ansible/collections/ansible_collections/infra/aap_utilities/roles/aap_setup_download/tasks/main.yml': line 38, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Extract the name of the downloaded installer to aap_setup_down_installer_file\n  ^ here\n"}
philthynz commented 1 year ago

Debugged this today.

The __aap_setup_down_images fact seems to have a different struture of binaries between versions 2.2 and 2.3.

2.2

ok: [localhost] => (item={'imageName': 'Ansible Automation Platform 2.2.2 Setup Bundle', 'filename': 'ansible-automation-platform-setup-bundle-2.2.2-1.tar.gz', 'arch': 'x86_64', 'datePublished': '2023-03-09T18:13:40.000Z', 'checksum': 'a93c4133158150c2d542009112a6876741f42d069e5776ba1946e6cbb028593c', 'downloadHref': 'https://api.access.redhat.com/management/v1/images/a93c4133158150c2d542009112a6876741f42d069e5776ba1946e6cbb028593c/download'}) => {
    "ansible_loop_var": "item",
    "item": {
        "arch": "x86_64",
        "checksum": "a93c4133158150c2d542009112a6876741f42d069e5776ba1946e6cbb028593c",
        "datePublished": "2023-03-09T18:13:40.000Z",
        "downloadHref": "https://api.access.redhat.com/management/v1/images/a93c4133158150c2d542009112a6876741f42d069e5776ba1946e6cbb028593c/download",
        "filename": "ansible-automation-platform-setup-bundle-2.2.2-1.tar.gz",
        "imageName": "Ansible Automation Platform 2.2.2 Setup Bundle"
    },
    "item.downloadHref": "https://api.access.redhat.com/management/v1/images/a93c4133158150c2d542009112a6876741f42d069e5776ba1946e6cbb028593c/download"
}
ok: [localhost] => (item={'imageName': 'Ansible Automation Platform 2.2.2 Setup', 'filename': 'ansible-automation-platform-setup-2.2.2-1.tar.gz', 'arch': 'x86_64', 'datePublished': '2023-03-09T18:13:39.000Z', 'checksum': '56adc8cc40e82568317237a63571ac857d9662b6c649fcc5a54cf7958f09a9a8', 'downloadHref': 'https://api.access.redhat.com/management/v1/images/56adc8cc40e82568317237a63571ac857d9662b6c649fcc5a54cf7958f09a9a8/download'}) => {
    "ansible_loop_var": "item",
    "item": {
        "arch": "x86_64",
        "checksum": "56adc8cc40e82568317237a63571ac857d9662b6c649fcc5a54cf7958f09a9a8",
        "datePublished": "2023-03-09T18:13:39.000Z",
        "downloadHref": "https://api.access.redhat.com/management/v1/images/56adc8cc40e82568317237a63571ac857d9662b6c649fcc5a54cf7958f09a9a8/download",
        "filename": "ansible-automation-platform-setup-2.2.2-1.tar.gz",
        "imageName": "Ansible Automation Platform 2.2.2 Setup"
    },
    "item.downloadHref": "https://api.access.redhat.com/management/v1/images/56adc8cc40e82568317237a63571ac857d9662b6c649fcc5a54cf7958f09a9a8/download"
}
ok: [localhost] => (item={'imageName': 'Ansible Automation Platform 2.2.1 Setup', 'filename': 'ansible-automation-platform-setup-2.2.1-3.tar.gz', 'arch': 'x86_64', 'datePublished': '2023-01-23T14:47:58.000Z', 'checksum': '902d4afa5b4160469d8f00b87d27fb289c22be459219ab9bea55b599ca4e03ae', 'downloadHref': 'https://api.access.redhat.com/management/v1/images/902d4afa5b4160469d8f00b87d27fb289c22be459219ab9bea55b599ca4e03ae/download'}) => {
    "ansible_loop_var": "item",
    "item": {
        "arch": "x86_64",
        "checksum": "902d4afa5b4160469d8f00b87d27fb289c22be459219ab9bea55b599ca4e03ae",
        "datePublished": "2023-01-23T14:47:58.000Z",
        "downloadHref": "https://api.access.redhat.com/management/v1/images/902d4afa5b4160469d8f00b87d27fb289c22be459219ab9bea55b599ca4e03ae/download",
        "filename": "ansible-automation-platform-setup-2.2.1-3.tar.gz",
        "imageName": "Ansible Automation Platform 2.2.1 Setup"
    },
    "item.downloadHref": "https://api.access.redhat.com/management/v1/images/902d4afa5b4160469d8f00b87d27fb289c22be459219ab9bea55b599ca4e03ae/download"
}
ok: [localhost] => (item={'imageName': 'Ansible Automation Platform 2.2.1 Setup Bundle', 'filename': 'ansible-automation-platform-setup-bundle-2.2.1-3.tar.gz', 'arch': 'x86_64', 'datePublished': '2023-01-23T14:47:58.000Z', 'checksum': '87811aebbe2c6bd2e6bf189edd2663da7646a3b9c90ab3fa2086870dba8855d8', 'downloadHref': 'https://api.access.redhat.com/management/v1/images/87811aebbe2c6bd2e6bf189edd2663da7646a3b9c90ab3fa2086870dba8855d8/download'}) => {
    "ansible_loop_var": "item",
    "item": {
        "arch": "x86_64",
        "checksum": "87811aebbe2c6bd2e6bf189edd2663da7646a3b9c90ab3fa2086870dba8855d8",
        "datePublished": "2023-01-23T14:47:58.000Z",
        "downloadHref": "https://api.access.redhat.com/management/v1/images/87811aebbe2c6bd2e6bf189edd2663da7646a3b9c90ab3fa2086870dba8855d8/download",
        "filename": "ansible-automation-platform-setup-bundle-2.2.1-3.tar.gz",
        "imageName": "Ansible Automation Platform 2.2.1 Setup Bundle"
    },
    "item.downloadHref": "https://api.access.redhat.com/management/v1/images/87811aebbe2c6bd2e6bf189edd2663da7646a3b9c90ab3fa2086870dba8855d8/download"
}
ok: [localhost] => (item={'imageName': 'Ansible Automation Platform 2.2.0 Setup Bundle', 'filename': 'ansible-automation-platform-setup-bundle-2.2.0-8.1.tar.gz', 'arch': 'x86_64', 'datePublished': '2022-08-16T15:44:43.000Z', 'checksum': 'ad7a47fe00a52347eac978a99e96392decfdff121e4e61f0e038c7d6603d37f5', 'downloadHref': 'https://api.access.redhat.com/management/v1/images/ad7a47fe00a52347eac978a99e96392decfdff121e4e61f0e038c7d6603d37f5/download'}) => {
    "ansible_loop_var": "item",
    "item": {
        "arch": "x86_64",
        "checksum": "ad7a47fe00a52347eac978a99e96392decfdff121e4e61f0e038c7d6603d37f5",
        "datePublished": "2022-08-16T15:44:43.000Z",
        "downloadHref": "https://api.access.redhat.com/management/v1/images/ad7a47fe00a52347eac978a99e96392decfdff121e4e61f0e038c7d6603d37f5/download",
        "filename": "ansible-automation-platform-setup-bundle-2.2.0-8.1.tar.gz",
        "imageName": "Ansible Automation Platform 2.2.0 Setup Bundle"
    },
    "item.downloadHref": "https://api.access.redhat.com/management/v1/images/ad7a47fe00a52347eac978a99e96392decfdff121e4e61f0e038c7d6603d37f5/download"
}
ok: [localhost] => (item={'imageName': 'Ansible Automation Platform 2.2.0 Setup', 'filename': 'ansible-automation-platform-setup-2.2.0-8.tar.gz', 'arch': 'x86_64', 'datePublished': '2022-08-04T23:20:13.000Z', 'checksum': '39c5f84421585fe0171fc0532d3507d195fc32bf5b74e53bfd4e9bcca7a0fcd0', 'downloadHref': 'https://api.access.redhat.com/management/v1/images/39c5f84421585fe0171fc0532d3507d195fc32bf5b74e53bfd4e9bcca7a0fcd0/download'}) => {
    "ansible_loop_var": "item",
    "item": {
        "arch": "x86_64",
        "checksum": "39c5f84421585fe0171fc0532d3507d195fc32bf5b74e53bfd4e9bcca7a0fcd0",
        "datePublished": "2022-08-04T23:20:13.000Z",
        "downloadHref": "https://api.access.redhat.com/management/v1/images/39c5f84421585fe0171fc0532d3507d195fc32bf5b74e53bfd4e9bcca7a0fcd0/download",
        "filename": "ansible-automation-platform-setup-2.2.0-8.tar.gz",
        "imageName": "Ansible Automation Platform 2.2.0 Setup"
    },
    "item.downloadHref": "https://api.access.redhat.com/management/v1/images/39c5f84421585fe0171fc0532d3507d195fc32bf5b74e53bfd4e9bcca7a0fcd0/download"
}

2.3

ok: [localhost] => (item={'imageName': 'Ansible Automation Platform 2.3 Setup Bundle', 'filename': 'ansible-automation-platform-setup-bundle-2.3-2.1.tar.gz', 'arch': 'x86_64', 'datePublished': '2023-04-20T18:56:00.000Z', 'checksum': '7456b98f2f50e0e1d4c93fb4e375fe8a9174f397a5b1c0950915224f7f020ec4', 'downloadHref': 'https://api.access.redhat.com/management/v1/images/7456b98f2f50e0e1d4c93fb4e375fe8a9174f397a5b1c0950915224f7f020ec4/download'}) => {
    "ansible_loop_var": "item",
    "item": {
        "arch": "x86_64",
        "checksum": "7456b98f2f50e0e1d4c93fb4e375fe8a9174f397a5b1c0950915224f7f020ec4",
        "datePublished": "2023-04-20T18:56:00.000Z",
        "downloadHref": "https://api.access.redhat.com/management/v1/images/7456b98f2f50e0e1d4c93fb4e375fe8a9174f397a5b1c0950915224f7f020ec4/download",
        "filename": "ansible-automation-platform-setup-bundle-2.3-2.1.tar.gz",
        "imageName": "Ansible Automation Platform 2.3 Setup Bundle"
    },
    "item.downloadHref": "https://api.access.redhat.com/management/v1/images/7456b98f2f50e0e1d4c93fb4e375fe8a9174f397a5b1c0950915224f7f020ec4/download"
}
ok: [localhost] => (item={'imageName': 'Ansible Validated Content', 'filename': 'ansible-validated-content-bundle-1.1.tar.gz', 'arch': 'x86_64', 'datePublished': '2023-04-04T15:59:28.000Z', 'checksum': 'c0d2eb18e7a87c77f5660b41ce8dc85e5e64841e95986a553ae90edecdc30f0c', 'downloadHref': 'https://api.access.redhat.com/management/v1/images/c0d2eb18e7a87c77f5660b41ce8dc85e5e64841e95986a553ae90edecdc30f0c/download'}) => {
    "ansible_loop_var": "item",
    "item": {
        "arch": "x86_64",
        "checksum": "c0d2eb18e7a87c77f5660b41ce8dc85e5e64841e95986a553ae90edecdc30f0c",
        "datePublished": "2023-04-04T15:59:28.000Z",
        "downloadHref": "https://api.access.redhat.com/management/v1/images/c0d2eb18e7a87c77f5660b41ce8dc85e5e64841e95986a553ae90edecdc30f0c/download",
        "filename": "ansible-validated-content-bundle-1.1.tar.gz",
        "imageName": "Ansible Validated Content"
    },
    "item.downloadHref": "https://api.access.redhat.com/management/v1/images/c0d2eb18e7a87c77f5660b41ce8dc85e5e64841e95986a553ae90edecdc30f0c/download"
}
ok: [localhost] => (item={'imageName': 'Ansible Automation Platform 2.3 Setup', 'filename': 'ansible-automation-platform-setup-2.3-2.tar.gz', 'arch': 'x86_64', 'datePublished': '2023-03-16T13:00:52.000Z', 'checksum': '879e97e4c63de3727657284eb05a3a9e9897c66bd5059183d804d20f579c75a0', 'downloadHref': 'https://api.access.redhat.com/management/v1/images/879e97e4c63de3727657284eb05a3a9e9897c66bd5059183d804d20f579c75a0/download'}) => {
    "ansible_loop_var": "item",
    "item": {
        "arch": "x86_64",
        "checksum": "879e97e4c63de3727657284eb05a3a9e9897c66bd5059183d804d20f579c75a0",
        "datePublished": "2023-03-16T13:00:52.000Z",
        "downloadHref": "https://api.access.redhat.com/management/v1/images/879e97e4c63de3727657284eb05a3a9e9897c66bd5059183d804d20f579c75a0/download",
        "filename": "ansible-automation-platform-setup-2.3-2.tar.gz",
        "imageName": "Ansible Automation Platform 2.3 Setup"
    },
    "item.downloadHref": "https://api.access.redhat.com/management/v1/images/879e97e4c63de3727657284eb05a3a9e9897c66bd5059183d804d20f579c75a0/download"
}
ok: [localhost] => (item={'imageName': 'Event Driven Automation 0.1.0 (Dev Preview - Source Only)', 'filename': 'eda-server-0.1.0.tar.gz', 'arch': 'x86_64', 'datePublished': '2022-12-13T17:24:08.000Z', 'checksum': 'a414482ab3cce6d2f6932daff4362cb5bfe18271425d3c16217020886fb0d02c', 'downloadHref': 'https://api.access.redhat.com/management/v1/images/a414482ab3cce6d2f6932daff4362cb5bfe18271425d3c16217020886fb0d02c/download'}) => {
    "ansible_loop_var": "item",
    "item": {
        "arch": "x86_64",
        "checksum": "a414482ab3cce6d2f6932daff4362cb5bfe18271425d3c16217020886fb0d02c",
        "datePublished": "2022-12-13T17:24:08.000Z",
        "downloadHref": "https://api.access.redhat.com/management/v1/images/a414482ab3cce6d2f6932daff4362cb5bfe18271425d3c16217020886fb0d02c/download",
        "filename": "eda-server-0.1.0.tar.gz",
        "imageName": "Event Driven Automation 0.1.0 (Dev Preview - Source Only)"
    },
    "item.downloadHref": "https://api.access.redhat.com/management/v1/images/a414482ab3cce6d2f6932daff4362cb5bfe18271425d3c16217020886fb0d02c/download"
}
ok: [localhost] => (item={'imageName': 'Ansible Rulebook 0.9.4 (Dev Preview - Source Only)', 'filename': 'ansible-rulebook-0.9.4.tar.gz', 'arch': 'x86_64', 'datePublished': '2022-12-13T17:08:53.000Z', 'checksum': '9c75400190475a0beced9f8319123e9725b84a295f0fc8b2b2d03f8d83cb4469', 'downloadHref': 'https://api.access.redhat.com/management/v1/images/9c75400190475a0beced9f8319123e9725b84a295f0fc8b2b2d03f8d83cb4469/download'}) => {
    "ansible_loop_var": "item",
    "item": {
        "arch": "x86_64",
        "checksum": "9c75400190475a0beced9f8319123e9725b84a295f0fc8b2b2d03f8d83cb4469",
        "datePublished": "2022-12-13T17:08:53.000Z",
        "downloadHref": "https://api.access.redhat.com/management/v1/images/9c75400190475a0beced9f8319123e9725b84a295f0fc8b2b2d03f8d83cb4469/download",
        "filename": "ansible-rulebook-0.9.4.tar.gz",
        "imageName": "Ansible Rulebook 0.9.4 (Dev Preview - Source Only)"
    },
    "item.downloadHref": "https://api.access.redhat.com/management/v1/images/9c75400190475a0beced9f8319123e9725b84a295f0fc8b2b2d03f8d83cb4469/download"
}

I will make a PR to increase the filter for Downloading the latest installer of type {{ aap_setup_down_type }} task. The loop over __aap_setup_down_images[:2] just needs to be extended to 3. So __aap_setup_down_images[:3].