Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiencing an error with the infra.controller_configuration.license module. #772

Closed
hammer-redhat opened this issue Feb 18, 2024 · 2 comments
Labels
bug Something isn't working new New issue, this should be removed once reviewed

Comments

@hammer-redhat
Copy link

Summary

Experiencing an error with the infra.controller_configuration.license module.

When running my playbook, it updates the manifest with the file specified but it is continuing to attempt to get subscriptions with a filter and then install them as well. If I remove the subscriptions username/password from the vars it works but if I add them it continues to attempt both methods of licensing tasks.

Issue Type

  • Bug Report

Ansible, Collection, Controller details

ansible [core 2.14.9]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['../.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = ../.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.9.18 (main, Jan  4 2024, 00:00:00) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

# ../.ansible/collections/ansible_collections
Collection                     Version
------------------------------ -------
ansible.posix                  1.5.4  
awx.awx                        23.8.1 
infra.aap_utilities            2.4.0  
infra.controller_configuration 2.6.0  
kubernetes.core                3.0.0

Ansible Automation Platform Controller 4.5.1
  • ansible installation method: OS Package

OS / ENVIRONMENT

$ cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="9.3 (Plow)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="9.3"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Red Hat Enterprise Linux 9.3 (Plow)"
ANSI_COLOR="0;31"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:redhat:enterprise_linux:9::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 9"
REDHAT_BUGZILLA_PRODUCT_VERSION=9.3
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.3"

Desired Behavior

Either the manifest is uploaded or the subscriptions are searched for and allocated but not both.

Actual Behavior

The specified manifest is uploaded but it continues to attempt to register subscriptions with username/password.

$ ansible-playbook aap_cac_license.yml -b
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

PLAY [Playbook to configure ansible controller post installation] ********************************************************************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [infra.controller_configuration.license : Validating arguments against arg spec 'main' - An Ansible Role to deploy a license on Ansible Controller.] ****************************************************************
ok: [localhost]

TASK [infra.controller_configuration.license : Use manifest file] ********************************************************************************************************************************************************
included: ../.ansible/collections/ansible_collections/infra/controller_configuration/roles/license/tasks/manifest.yml for localhost

TASK [infra.controller_configuration.license : Ensure manifest is set] ***************************************************************************************************************************************************
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [infra.controller_configuration.license : Move manifest file to temporary location] *********************************************************************************************************************************
ok: [localhost]

TASK [infra.controller_configuration.license : Fetch manifest from URL] **************************************************************************************************************************************************
skipping: [localhost]

TASK [infra.controller_configuration.license : Create manifest file from base64 encoded content] *************************************************************************************************************************
skipping: [localhost]

TASK [infra.controller_configuration.license : Install the Controller license] *******************************************************************************************************************************************
[WARNING]: You are using the awx version of this collection but connecting to Red Hat Ansible Automation Platform
changed: [localhost]

TASK [infra.controller_configuration.license : Use subscription pool id or subscription lookup] **************************************************************************************************************************
included: ../.ansible/collections/ansible_collections/infra/controller_configuration/roles/license/tasks/subscription.yml for localhost

TASK [infra.controller_configuration.license : Get subscriptions with a filter] ******************************************************************************************************************************************
skipping: [localhost]

TASK [infra.controller_configuration.license : Install the Controller license] *******************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'subscriptions'. 'dict object' has no attribute 'subscriptions'\n\nThe error appears to be in '../.ansible/collections/ansible_collections/infra/controller_configuration/roles/license/tasks/subscription.yml': line 22, 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: Install the Controller license\n  ^ here\n"}

PLAY RECAP ***************************************************************************************************************************************************************************************************************
localhost                  : ok=7    changed=1    unreachable=0    failed=1    skipped=3    rescued=0    ignored=0 

STEPS TO REPRODUCE

---
- name: Playbook to configure ansible controller post installation
  hosts: localhost
  connection: local
  vars:
    controller_validate_certs: false
    controller_hostname: automation-controller.hammer.lan
    controller_username: admin
    controller_password: ...
    redhat_subscription_username: ...
    redhat_subscription_password: ...
    controller_license:
      manifest_file: ./files/manifest_automation-controller.zip
      force: true
  roles:
    - role: infra.controller_configuration.license

image

@hammer-redhat hammer-redhat added bug Something isn't working new New issue, this should be removed once reviewed labels Feb 18, 2024
@djdanielsson
Copy link
Collaborator

It chooses based off what variables are provided, because you provide both it tries to use both

@hammer-redhat
Copy link
Author

Understood, just wanted to let you know in the case this behavior wasn’t intentional.

I’ll close it in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new New issue, this should be removed once reviewed
Projects
None yet
Development

No branches or pull requests

2 participants