Bug 2004474

Summary: Missing backport to work with inject_fact_as_var=false ansible option
Product: Red Hat OpenStack Reporter: Brendan Shephard <bshephar>
Component: ansible-role-redhat-subscriptionAssignee: Brendan Shephard <bshephar>
Status: CLOSED ERRATA QA Contact: David Rosenfeld <drosenfe>
Severity: medium Docs Contact:
Priority: medium    
Version: 16.1 (Train)CC: emacchi
Target Milestone: z8Keywords: Triaged
Target Release: 16.1 (Train on RHEL 8.2)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ansible-role-redhat-subscription-1.1.1-1.20210915133322.6d26afa.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-24 11:01:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Brendan Shephard 2021-09-15 12:10:13 UTC
Description of problem:
During a minor update of 16.1, the update fails with:
2021-09-15 11:53:45,820 p=1794 u=mistral n=ansible | fatal: [Controller00]: FAILED! => {"msg": "The conditional check 'ansible_pkg_mgr == 'yum'' failed. The error was: error while evaluating conditional (ansible_pkg_mgr == 'yum'): 'ansible_pkg_mgr' is undefined\n\nThe error appears to be in '/usr/share/ansible/roles/redhat-subscription/tasks/main.yml': line 34, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n  block:\n    - name: Set rhsm_package_manager_config_file for yum\n      ^ here\n"}
2021-09-15 11:53:45,820 p=1794 u=mistral n=ansible | NO MORE HOSTS LEFT *************************************************************
2021-09-15 11:53:45,822 p=1794 u=mistral n=ansible | PLAY RECAP *********************************************************************
2021-09-15 11:53:45,822 p=1794 u=mistral n=ansible | Controller00             : ok=180  changed=82   unreachable=0    failed=1    skipped=397  rescued=0    ignored=0
2021-09-15 11:53:45,822 p=1794 u=mistral n=ansible | Controller01             : ok=5    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
2021-09-15 11:53:45,822 p=1794 u=mistral n=ansible | Controller02             : ok=5    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
2021-09-15 11:53:45,823 p=1794 u=mistral n=ansible | Wednesday 15 September 2021  11:53:45 +0200 (0:00:00.061)       0:11:11.060 ***
2021-09-15 11:53:45,823 p=1794 u=mistral n=ansible | ===============================================================================

Version-Release number of selected component (if applicable):
https://access.redhat.com/downloads/content/rhel---8/x86_64/9895/ansible-role-redhat-subscription/1.1.1-1.20201114001023.el8ost/noarch/fd431d51/package

How reproducible:
100%

Steps to Reproduce:
1. Use subscription manager during the initial deployment
2. Try to perform a minor update
3. Observe the above mentioned failure

Actual results:
Deployment fails while trying to reference ansible_* facts

Expected results:
Should use ansible_facts['fact-name'] instead

Additional info:
16.1 is missing this patch:
https://github.com/openstack/ansible-role-redhat-subscription/commit/7400e5a9d972a6e2854113cdadc66836547718ee

Comment 11 errata-xmlrpc 2022-03-24 11:01:35 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat OpenStack Platform 16.1.8 bug fix and enhancement advisory), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:0986