controller_configuration icon indicating copy to clipboard operation
controller_configuration copied to clipboard

infra.aap_configuration.controller_license fails with username and password

Open ikke-t opened this issue 7 months ago • 5 comments

Summary

I want to subscribe my AAP using user credentials, but it fails to unknown variable while running it.

Issue Type

  • Bug Report

Ansible, Collection, Controller details

ansible [core 2.18.1]
  config file = /var/home/itengval/src/redhatnordicssa/cool-lab/ansible.cfg
  configured module search path = ['/var/home/itengval/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /var/home/itengval/.local/lib/python3.13/site-packages/ansible
  ansible collection location = /var/home/itengval/.ansible/collections:/usr/share/ansible/collections
  executable location = /var/home/itengval/.local/bin/ansible
  python version = 3.13.2 (main, Feb  6 2025, 00:00:00) [GCC 15.0.1 20250204 (Red Hat 15.0.1-0)] (/usr/bin/python3)
  jinja version = 3.1.5
  libyaml = True


# /var/home/itengval/.ansible/collections/ansible_collections
Collection                       Version     
-------------------------------- ------------
community.general                10.1.0      
community.kubernetes             2.0.1       
kubernetes.core                  2.3.0       

# /var/home/itengval/src/redhatnordicssa/cool-lab/collections/ansible_collections
Collection                       Version     
-------------------------------- ------------
amazon.aws                       9.3.0       
ansible.controller               4.6.8       
ansible.eda                      2.6.0       
ansible.hub                      1.0.0       
ansible.platform                 2.5.20250213
ansible.posix                    2.0.0       
awx.awx                          24.6.1      
cloud.common                     4.0.0       
community.crypto                 2.25.0      
community.general                10.4.0      
community.vmware                 5.4.0       
containers.podman                1.16.3      
dynatrace.oneagent               1.2.3       
infra.aap_configuration          3.2.0       
infra.aap_configuration_extended 1.0.0       
kubernetes.core                  5.1.0       
microsoft.sql                    2.5.2       
myllynen.ansible_packer          2.1.0       
myllynen.rhel_ansible_roles      2.1.0       
myllynen.rhel_image              1.4.0       
redhat.rhel_idm                  1.14.5      
redhat.rhel_system_roles         1.88.9      
redhat.satellite                 5.1.0       
redhat.satellite_operations      3.0.0       
vmware.vmware                    1.10.1      
vmware.vmware_rest               4.6.0   

Controller version: aap-operator.v2.5.0-0.1743660124
  • ansible installation method: one of source, pip, OS package, EE

OCP AAP Operator

OS / ENVIRONMENT

OCP 4.18 + aap-operator.v2.5.0-0.1743660124

Desired Behavior

set the lisence using credentials.

Actual Behavior

Friday 25 April 2025  16:43:15 +0300 (0:00:05.905)       0:00:06.389 ********** 
fatal: [localhost]: FAILED! => {
    "msg": "The task includes an option with an undefined variable.. list object has no element 0\n\nThe error appears to be in '/var/home/itengval/src/redhatnordicssa/cool-lab/collections/ansible_collections/infra/aap_configuration/roles/controller_license/tasks/subscription.yml': line 21, 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: subscription | Install the Controller license\n  ^ here\n"

STEPS TO REPRODUCE

I set variables:

aap_configuration_secure_logging: false
controller_configuration_organizations_secure_logging: false
controller_configuration_credential_types_secure_logging: false
controller_configuration_credentials_secure_logging: false
controller_configuration_execution_environments_secure_logging: false
controller_configuration_projects_secure_logging: false
controller_configuration_inventories_secure_logging: false

redhat_subscription_username: "{{ vault_rh_subs_username }}"
redhat_subscription_password: "{{ vault_rh_subs_password }}"
controller_license:
  use_lookup: true
  filters:
    product_name: "Red Hat Ansible Automation Platform"
    support_level: "Self-Support"

And run playbook with the variables:

- name: Configure automation hub
  connection: local
  hosts: all
  become: false
  gather_facts: false
  vars:
    aap_username: admin
    aap_password: "{{ vault_aap_admin_password }}"
    aap_validate_certs: false
  vars_files:
    - aap_configs_dir/vars_content.yml
    - aap_configs_dir/vars_creds.yml
    - aap_configs_dir/vars_gw.yml
    - aap_configs_dir/vars_hub.yml
    - aap_configs_dir/vars_license.yml
    - aap_configs_dir/vars_organizations.yml

  roles:
    # Setup license
    - infra.aap_configuration.controller_license 

and run the playbook:

ansible-playbook -i localhost, -e @../private-lab/secrets.yml aap_configure_subset.yml

ikke-t avatar Apr 25 '25 13:04 ikke-t