Code Monkey home page Code Monkey logo

aap_utilities's People

Contributors

alawong avatar aoyawale avatar branic avatar chofstede avatar crenwick93 avatar djdanielsson avatar ericzolf avatar github-actions[bot] avatar inderpaltiwana avatar jce-redhat avatar jeffwarnica avatar jon4hz avatar jwalzer avatar kubealex avatar lshake avatar mikecantcode avatar philthynz avatar rev3r4nt avatar sabre1041 avatar sean-m-sullivan avatar semlohnayr avatar snagoor avatar spyrexd avatar tompage1994 avatar willtome avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aap_utilities's Issues

Add example implementation to prepare/install roles

The roles don't really have an obvious example to follow for installing AAP.

In particular it isn't obvious what needs to be set for aap_setup_prep_inv_nodes and aap_setup_prep_inv_vars. The readme does point to the defaults but that isn't really documentation.

Just adding to the example at the bottom of the prepare and install roles' readmes would be a good start here.

add something like:

...
vars:
  aap_setup_prep_inv_nodes:
    automationcontroller:
      autoctl1.example.com: 
      autoctl2.example.com: 
  aap_setup_prep_inv_vars:
    ...

RHEL version needs to be string

fatal: [127.0.0.1]: FAILED! => {"msg": "The conditional check '(aap_setup_down_type + '-' + aap_setup_down_version) in item.filename' failed. The error was: Unexpected templating type error occurred on ({% if (aap_setup_down_type + '-' + aap_setup_down_version) in item.filename %} True {% else %} False {% endif %}): can only concatenate str (not "float") to str\n\nThe error appears to be in '/root/.ansible/collections/ansible_collections/redhat_cop/aap_utilities/roles/aap_setup_download/tasks/main.yml': line 27, 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: downloading the latest installer of type {{ aap_setup_down_type }}\n ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes. Always quote template expression brackets when they\nstart a value. For instance:\n\n with_items:\n - {{ foo }}\n\nShould be written as:\n\n with_items:\n - "{{ foo }}"\n"}

Add support for AAP containerized installer

Discussed in #224

Originally posted by spyrexd March 25, 2024
Support using the containerized installer when downloading and installing AAP.

Allow setting the arch of the installer to enable containerized installs to VMs running on aarch64.

Ability to define Instance Groups during aap_setup_install

I'm using 2.2.4

I can't find the ability to define an Instance Group.

Using the "traditional" inventory definition-> setup.sh pre-flight->setup.sh, it's possible to define for instance a group:

[isolated_node_bastion]
node1
node2

Right now I can only use

execution_nodes:
    - execution-1.example
    - execution-2.example

to add dedicated execution node.

But there doesn't seem to be a way to assign these execution_nodes to a specific Instance Group

Backup role does not add much value

Looking at the backup role, it is just running the backup command (setup.sh -b). Is there something else the role can perform? otherwise I could just run the setup.sh command myself. Also, I'm not sure why the role asks for Postgres credentials etc when all of this info should be in the inventory file and leveraged using setup.sh -i inventory -b command.

Also, of course, need to rewrite the role to talk about AAP instead of Tower.

RHEL9 support

while going through these roles I noticed that we have rhel8 hard coded here

aap_setup_down_release: "ansible-automation-platform-{{ aap_setup_down_version }}-for-rhel-8-x86_64-files"

I think we should change this to default 8 but if we gather facts and this is being run on a RHEL9 server it should pull the rhel9 copy.

pre-tasks inventory.js Automation Hub variables

I think this may be a typo?

automationhub_pg_database='{{ tower_ah_pg_database }}'
automationhub_pg_username='{{ tower_ah_pg_database }}'
automationhub_pg_password='{{ tower_ah_pg_database }}'

Surely we aren't setting all of these as tower_ah_pg_database? Should this not be:

automationhub_pg_database='{{ tower_ah_pg_database }}'
automationhub_pg_username='{{ tower_ah_pg_username }}'
automationhub_pg_password='{{ tower_ah_pg_password }}'

Cannot inject additional values via -e @conf.yaml into installer

Summary

The aap_setup_install role hardcodes the commandline to call the setup.sh of the installer in a way, that only key=value variables are possible.
Adding complex variables via the -e @conf.yaml parameter is not supported because of the hardcoded template.

Issue Type

  • Bug Report

The aap_setup_install role hardcodes the commandline to call the setup.sh of the installer in a way, that only key=value variables are possible.
Adding complex variables via the -e @conf.yaml parameter is not supported because of the hardcoded template:

-e {{ varkey }}={{ aap_setup_inst_extra_vars[varkey] | quote }}

This is in conflict with some of the RedHat guides like LDAP integration (i.e. https://access.redhat.com/solutions/6977153) where it specifically documents in the resolution:

  • Any extra LDAP parameters that need to be set must be defined in a dictionary named ldap_extra_settings, for example one can create a YAML file as such:
#ldapextras.yml   
---
ldap_extra_settings:
     AUTH_LDAP_USER_ATTR_MAP: '{"first_name": "givenName", "last_name": "sn", "email": "mail"}'
...

The above file can then be passed to the AAP installer using setup.sh -e @ldapextras.yml.

Ansible, Collection, Docker/Podman details

This is independent of the ansible or ansible-galaxy version, as it is a problem with the code in the install-role clearly linked above

  • ansible installation method: one of source, pip, OS package, EE

This Bug is independent from the ansible installation method

OS / ENVIRONMENT

This Bug is independent from the OS/Environment

Desired Behavior

I want to provide an additionals vars file to the installer via the -e @file.yaml directive in the aap_setup_install role

Actual Behavior

I cannot provide the additional @file.yaml parameter, because the syntax doesn't make this possible

STEPS TO REPRODUCE

Try to call the aap_setup_install role with an -e @file directive

Change the Instance checkers to use the inventory variables

- name: Check Ansible Tower Running
uri:
url: "https://{{ controller_hostname }}/api/v2/ping/"
method: GET
user: "{{ controller_username }}"
password: "{{ controller_password }}"
validate_certs: "{{ controller_validate_certs | default(omit) }}"
force_basic_auth: true
register: __aap_setup_inst_ctl_check
ignore_errors: true
failed_when: false
when:
- "'automationcontroller' in aap_setup_prep_inv_nodes"
- not aap_setup_inst_force | bool
- name: Check Automation Hub Running
uri:
url: "https://{{ ah_hostname }}/api/galaxy/"
method: GET
user: "{{ ah_username }}"
password: "{{ ah_password }}"
validate_certs: "{{ ah_validate_certs | default(omit) }}"
force_basic_auth: true
register: __aap_setup_inst_ah_check
ignore_errors: true
failed_when: false
when:
- "'automationhub' in aap_setup_prep_inv_nodes"
- not aap_setup_inst_force | bool

For the status checks we should use the inventory variables
automationhub_admin_password
admin_password

README for aap_ocp_install role suggest to use wrong variable name

Summary

The README for the aap_ocp_install role suggests to use aap_ocp_install_connection, but code uses aap_ocp_install_ocp_connection that references ocp twice in the variable name. I recommend fixing the code to match the more sensible variable name.

Issue Type

  • Bug Report

Ansible, Collection, Docker/Podman details

ansible --version

ansible-galaxy collection list

podman --version
  • ansible installation method: one of source, pip, OS package, EE

OS / ENVIRONMENT

Desired Behavior

Actual Behavior

Please give some details of what is actually happening.
Include a minimum complete verifiable example with:

  • playbook / task
  • configuration file / list
  • error

STEPS TO REPRODUCE

aap_setup_install assumes dictionaries in aap_setup_prep_inv_nodes var

Hi, quick follow up to #192 because I figured out what caused my issue.

controller_hostname: "{{ (aap_setup_prep_inv_nodes['automationcontroller'].keys() | list)[0] }}"

This should probably be something like {{ aap_setup_prep_inv_nodes['automationcontroller'] | first }}. Same goes for ah_hostname and eda_hostname - or you keep the role as it is and adjust the example in the readme :)

Collection requirements

How do we want to handle requirements, In redhat_cop.controller_configuration we leave off awx.awx or ansible.controller because it lets the users use what they want.

With the addition of the ocp installer it requires either "redhat.openshift": ">=2.0.1", or community.okd, and galaxy complains if we set the galaxy.yml with something it can't find like redhat.openshift.

For now I've deleted it from the galaxy.yml, until we decide differently, but I am documenting it here.

Automation Hub Fails to Validate

The task "wait for automation hub to be running" fails to return a successful result (HTTP 403) as the Galaxy API requires authentication credentials be provided

controller_hostname and ah_hostname within aap_setup_install not variabilised

within the aap_setup_install role, 2 default variables, controller_hostname, and ah_hostname are used to check if controller and AH are running. However, they are set to (literally):

controller_hostname: aap_setup_prep_inv_nodes['automationcontroller'][0]
ah_hostname: aap_setup_prep_inv_nodes['automationhub'][0]

As they are missing the brackets, these tasks fail.

Add management roles/playbooks

Managing multiple AAP instances (dev,test,prod) or in different network zones is a challenge. The tasks often performed are:

  • start, stop, and restart of services
  • healthchecks
  • etc

Basic "Day 2" operations on AAP platform.

So, for example, I want to bring AAP down for some maintenance or whatnot, perhaps I run a playbook that ensures all running jobs are stopped, no new jobs are running, and then I shutdown the web layer (controller), the app layer (exec nodes) and then database layer (postgres) in that order to ensure a clean shutdown sequence. A playbook like that would be cool, which uses roles that support managing the different services (postgres, etc)

Or maybe I just want to bounce the postgres database service. Use a playbook/role for that. "aap_manage_postgres.yml" playbook would be called with extra var mode=restart for example.

Set up as a collection

Set up ansible collection, with github actions to push to galaxy as per tower-configuration

Tower references

I'm thinking the references to Tower in the README and some of the roles should be changed to Controller and/or Ansible Automation Platform.

Before opening a PR with changes I'd like to gather feedback on if the references should be changed. Thoughts?

tower_database[...whatever...] is documented almost everywhere, but only used in pre_tasks

The following command shows that tower_database[...whatever...] is documented almost everywhere, but only used in "pre_tasks":

tower_cert/README.md
backup/README.md
install/README.md
pre_tasks/defaults/main.yml
pre_tasks/tasks/main.yml
pre_tasks/templates/inventory.j2
pre_tasks/README.md
restore/README.md

I strongly suspect a wild cut&paste effect. We should do the same exercise of cleaning up README.md resp. defaults/main.yml as I did for the tower_configuration.

Originally posted by @ericzolf in #30 (comment)

Allow the option to simply ensure/check if namespace is created

Summary

The code in the initialization.yml task file attempts to create the namespace, but not all OpenShift configurations are setup where the team/user can do anything. In my current situation, the user does not have the ability to create namespaces and this permission is granted to OCP admins and not all users.

As a result, the following task fails but it should fail if the namespace does not exist, but succeed if already existing. Note that, I believe the reason it fails is because the template yaml only contains the name parameter for the Namespace, whereas the existing namespace that was created by the OCP Admins already, has a bunch of properties set on that. So the "Desired state" mechanism of Ansible is probably trying to replace that object with the simpler one defined by the template. This is another reason I want the ability to just check if a namespace exists with the same name - and not attempt to create one in OCP. This is only to ensure the pre-req exists (namespace).

- name: Create namespace
kubernetes.core.k8s:
host: "{{ __aap_ocp_install_auth_results['openshift_auth']['host'] }}"
api_key: "{{ __aap_ocp_install_auth_results['openshift_auth']['api_key'] }}"
validate_certs: "{{ aap_ocp_install_ocp_connection['validate_certs'] | default(omit) }}"
state: present
resource_definition: "{{ lookup('ansible.builtin.template', 'namespace.yaml.j2', template_vars=ns_vars) | from_yaml }}"
apply: true
vars:
ns_vars:
ns_name: "{{ aap_ocp_install_namespace }}"

Issue Type

  • Bug Report

Ansible, Collection, Docker/Podman details

ansible --version

ansible-galaxy collection list

podman --version
  • ansible installation method: one of source, pip, OS package, EE

OS / ENVIRONMENT

Desired Behavior

Actual Behavior

Please give some details of what is actually happening.
Include a minimum complete verifiable example with:

  • playbook / task
  • configuration file / list
  • error

STEPS TO REPRODUCE

aap_setup_install: Waiting for "eda controller" to be running,

using 2.3.0 on latest aap2.4-1.3

This is a minor issue I think:

TASK [infra.aap_utilities.aap_setup_install : Wait for automation hub to be running] *****************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: {{ (aap_setup_prep_inv_nodes['automationedacontroller'].keys() | list)[0] }}: 'list object' has no attribute 'keys'. 'list object' has no attribute 'keys'. {{ (aap_setup_prep_inv_nodes['automationedacontroller'].keys() | list)[0] }}: 'list object' has no attribute 'keys'. 'list object' has no attribute 'keys'\n\nThe error appears to be in '/root/.ansible/collections/ansible_collections/infra/aap_utilities/roles/aap_setup_install/tasks/main.yml': line 111, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n    - name: Wait for automation hub to be running\n      ^ here\n"}

I can't see what keys are missing really, I'm not sure what's different than with AutomationHub task which seats just above in the tasks/main.yml. The name should be fixed but appart from that I don't see what's amiss.

Here the inventory it generated and ran on:

[automationcontroller]
s00vl9993310.fr.net.intra
s00vl9995756.fr.net.intra

[automationedacontroller]
it-automation-eda-test.staging.echonet.net.intra

[database]
s01vl9981311.fr.net.intra

[automationhub]
s01vl9989234.fr.net.intra

[execution_nodes]
s00vl9974130.fr.net.intra
s00vl9974136.fr.net.intra

[instance_group_bastion]
s00vl9974130.fr.net.intra
s00vl9974136.fr.net.intra



[all:vars]
pulp_rhel_codeready_repo=[]
registry_username=admin
registry_password=<>
registry_url=s01vl9989234.fr.net.intra
pg_host=s01vl9981311.fr.net.intra
pg_port='5432'
pg_database=awx
pg_username=awx
pg_sslmode=prefer
automationhub_require_content_approval=True
automationhub_enable_unauthenticated_collection_access=True
automationhub_enable_unauthenticated_collection_download=True
automationhub_pg_host=s01vl9981311.fr.net.intra
automationhub_pg_port='5432'
automationhub_pg_database=automationhub
automationhub_pg_username=automationhub
automationhub_pg_sslmode=prefer
postgres_use_ssl=False
automationedacontroller_pg_host=s01vl9981311.fr.net.intra
automationedacontroller_pg_port='5432'
automationedacontroller_pg_database=automationedacontroller
automationedacontroller_pg_username=automationedacontroller
admin_password=<>
pg_password=<>
automationhub_admin_password=<>
automationhub_pg_password=<>
automationedacontroller_admin_password=<>
automationedacontroller_pg_password=<>
[automationcontroller:vars]
peers=instance_group_bastion
node_type=hybrid
[execution_nodes:vars]
node_type=execution

variables for the setup_prepare:

## prepare inventory
aap_setup_prep_process_template: true
aap_setup_prep_inv_nodes:
  automationcontroller: "{{ groups['automationcontroller'] }}"
  automationedacontroller: "{{ groups['automationedacontroller'] }}"
  database: "{{ groups['database'] | default(omit) }}"
  automationhub: "{{ groups['automationhub'] }}"
  execution_nodes: "{{ groups['execution_nodes'] }}"
  instance_group_bastion: "{{ groups['instance_group_bastion'] }}"

Add ability to specify certificate content

The aap_certs role only supports using files for the cert/key vars. It would be nice to be able to specify the cert/key content so we can use a secrets backend like HashiCorp Vault.

aap_setup_rhel_version confusion

aap_setup_rhel_version: "{{ ansible_distribution_major_version | default(8, true) }}"

has issues if the installer is not run on the same destination OS, we might grab this from an inventory item? or just set it to 9, and let user overwrite it, or update the docs.

Move away setup.log before restarting an installation

I realized that setup.log isn't overwritten by setup.sh if it already exists, so that the log gets lost in such cases (at least if running setup.sh as non-root). There should hence be the possibility to move away a potentially existing setup.log. It's not as easy as it sounds because Ansible doesn't have a good option to move things (I don't think we want to simply remove the log file).

Incorrect installation setup bundle extracted and configured

Summary

infra.aap_utilities.aap_setup_download downloads 2 different setup types

  1. ansible-automation-platform-containerized-setup-2.4-1.tar.gz
  2. ansible-automation-platform-setup-2.4-2.tar.gz

Issue Type

  • Bug Report

Ansible, Collection, Docker/Podman details

ansible --version
ansible [core 2.14.2]
  config file = /root/aap/aap_standalone/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.11/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.11.2 (main, May 24 2023, 00:00:00) [GCC 11.3.1 20221121 (Red Hat 11.3.1-4)] (/usr/bin/python3.11)
  jinja version = 3.1.2
  libyaml = True

ansible-galaxy collection list

# /root/.ansible/collections/ansible_collections
Collection            Version
--------------------- -------
ansible.posix         1.5.4  
awx.awx               23.0.0 
community.crypto      2.15.1 
community.general     7.3.0  
infra.aap_utilities   2.3.0  
kubernetes.core       2.4.0  
nshaik.aap_collection 1.0.14 

podman --version
podman version 4.4.1
  • ansible installation method: one of source, pip, OS package, EE

OS / ENVIRONMENT

Ansible Controller installation on RHEL 9.2 version

Desired Behavior

Installation inventory file should be configured in the correct installation bundle extracted folder

Actual Behavior

Installation bundle extracted and inventory file is configured in wrong location /var/tmp/ansible-automation-platform-containerized-setup-2.4-1/ where the correct collection should be /var/tmp/ansible-automation-platform-setup-2.4-2/

STEPS TO REPRODUCE

Sample variable file that was used to call infra.aap_utilities.aap_setup_download role

aap_setup_down_offline_token: "xxxxeyJhbGciOixxxx"
aap_setup_down_version: "2.4"
aap_setup_down_type: "setup"
aap_setup_rhel_version: "9"
aap_setup_prep_inv_nodes:
  automationcontroller:
    - controller.example.com
aap_setup_prep_inv_vars:
  automationcontroller: # denotes the automation controller nodes as hybrid nodes (controller and execution)
    node_type: hybrid
    ignore_preflight_errors: true
  all:
    pg_database: "awx"
    pg_username: "awx"
    pg_sslmode: "prefer"  # set to 'verify-full' for client-side enforced SSL
    registry_url: "registry.redhat.io"
    receptor_listener_port: 27199
aap_setup_prep_inv_secrets:
  all:
    registry_username: "myregistry_user"
    registry_password: "changeme"
    admin_password: "changeme"
    pg_password: "changeme"
controller_validate_certs: false

This caused the the infra.aap_utilities.aap_setup_install role to fail with the following error

TASK [infra.aap_utilities.aap_setup_install : Run the Ansible Automation Platform setup program] ***
task path: /root/.ansible/collections/ansible_collections/infra/aap_utilities/roles/aap_setup_install/tasks/main.yml:72
ASYNC FAILED on controller: jid=439834133810.20100
fatal: [controller]: FAILED! => {"ansible_job_id": "439834133810.20100", "changed": false, "cmd": "./setup.sh -i inventory", "finished": 1, "msg": "[Errno 2] No such file or directory: b'./setup.sh'", "rc": 2, "results_file": "/root/.ansible_async/439834133810.20100", "started": 1, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

Tower OpenShift Install

We want to be able to install Tower on OpenShift in the same way we can install Tower normally.

A tower_install_ocp (or similar) role should be created which follows the same pattern of tower_install

A pull request triggers twice the same pipeline

It's not a big issue as long as the pipeline is short, but starts to be annoying when the pipeline takes more time.

I have no experience with GitHub Actions and only slightly more with .travis.yml but the way we solved this issue on another project was to only trigger on commits/branches/tags having specific names (e.g. master/devel, tags looking like release numbers, and branches ending with '_', useful especially when you just want to test the pipeline).

aap_setup_download role has errors with AAP 2.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

  • Bug Report

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
  • ansible installation method: pip

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

Fix File permissions on tasks

roles/install_ocp/tasks/install_ocp.yml:29: [E208] File permissions not mentioned
roles/install_ocp/tasks/install_ocp.yml:45: [E208] File permissions not mentioned
roles/pre_tasks/tasks/pre_tasks.yml:14: [E208] File permissions not mentioned
roles/pre_tasks/tasks/pre_tasks.yml:28: [E208] File permissions not mentioned
roles/tower_cert/tasks/main.yml:2: [E208] File permissions not mentioned
roles/tower_cert/tasks/main.yml:10: [E208] File permissions not mentioned

This needs to be explored and tested, E208 has been disabled in a recent PR.

AAP 2 renamed groups

[tower] is now [automationcontroller] with the current AAP installer and it will error because it is using the old name.

Ah only installation

With the addition of the AH PR, if you only try to install AH it hangs up on the "Wait for ansible tower to be running." task. We should make it a little more robust to allow only AH installs.

Firewall code in roles

Putting this here to discuss the firewall code that is currently commented out. We could enable it through a var, or remove it, but want to make an issue at least to remind us its there.

aap_setup_download role fails to download setup bundle

Summary

infra.aap_utilities.aap_setup_download role fails to find and download the correct bundle as things change on the Red Hat CDN

Issue Type

  • Bug Report

Ansible, Collection, Docker/Podman details

infra.aap_utilities 2.3.0 version

ansible --version
ansible [core 2.15.5]
  config file = /var/lib/awx/projects/awxlab/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /var/lib/awx/projects/awxlab/collections
  executable location = /usr/bin/ansible
  python version = 3.9.16 (main, Sep 12 2023, 00:00:00) [GCC 11.3.1 20221121 (Red Hat 11.3.1-4)] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

ansible-galaxy collection list
Collection          Version
------------------- -------
ansible.posix       1.5.4  
awx.awx             23.0.0 
community.crypto    2.15.1 
community.general   7.3.0  
infra.aap_utilities 2.3.0  
kubernetes.core     2.4.0  
nshaik.aap          1.0.0 

podman --version
podman version 4.4.1
  • ansible installation method: one of source, pip, OS package, EE
  • RPM Package

OS / ENVIRONMENT

Desired Behavior

Actual Behavior

Please give some details of what is actually happening.
Include a minimum complete verifiable example with:

  • playbook / task
  • configuration file / list
  • error
TASK [infra.aap_utilities.aap_setup_download : Downloading the latest installer of type setup] ***
skipping: [aap.example.com] => (item={'imageName': 'Ansible Automation Platform 2.3 Setup Bundle', 'filename': 'ansible-automation-platform-setup-bundle-2.3-2.9.tar.gz', 'arch': 'x86_64', 'datePublished': '2023-10-17T16:55:44.000Z', 'checksum': 'ea1e70775533cedac9a9d331d7446b0dc2f555820187a7b15ed398e3da5bb00d', 'downloadHref': 'https://xxxxx/download'}) 
skipping: [aap.example.com] => (item={'imageName': 'Ansible Automation Platform 2.3 Setup Bundle', 'filename': 'ansible-automation-platform-setup-bundle-2.3-2.8.tar.gz', 'arch': 'x86_64', 'datePublished': '2023-10-10T16:03:55.000Z', 'checksum': 'e6772abc2f953c0619a9ee2869618a1b13cc5d6a0f1b98a1bcf1ff7225507612', 'downloadHref': 'https://xxxxx/download'}) 
skipping: [aap.example.com] => (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://xxxxx/download'}) 
skipping: [aap.example.com]

TASK [infra.aap_utilities.aap_setup_download : Extract the name of the downloaded installer to aap_setup_down_installer_file] ***
fatal: [aap.example.com]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: list object has no element 0. list object has no element 0\\n\\nThe error appears to be in '/runner/project/collections/ansible_collections/infra/aap_utilities/roles/aap_setup_download/tasks/main.yml': line 40, 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

Use the basic playbook to download infra.aap_utilities.aap_setup_download role
This is the debug json output of `Simplify the list of possible downloads - Task`
https://gist.github.com/snagoor/9f5957f90e15cef59d6478cc0f96d1e2

Cleanup Branches

@ericzolf I was looking at the branches, trying to find your aap_setup_prepare. Is it ok if we go and delete all your merged branches?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.