Closed philthynz closed 1 year ago
For fun try RHEL 8 please, I am curious if it's a bug with RHEL 9 variable.
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"}
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]
.
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
OS / ENVIRONMENT
WSL Ubuntu 20.04
Desired Behavior
Package downloads
Actual Behavior
Package does not download
Console log
STEPS TO REPRODUCE
Run playbook command on playbooks file