Bug 1643397 - Satellite registration fails for OCP 3.10 and OCP 3.11 installation with openshift-ansible
Summary: Satellite registration fails for OCP 3.10 and OCP 3.11 installation with open...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.11.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 3.11.z
Assignee: Russell Teague
QA Contact: Johnny Liu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-10-26 07:48 UTC by broskos
Modified: 2019-11-18 14:52 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Required packages are not installed for Satellite registration to complete successfully. Consequence: Satellite registration fails and openshift packages are not available. Fix: Moves the install of required packages earlier in the subscription process to ensure satellite subscription succeeds. Result: Openshift packages are available from Satellite.
Clone Of:
Environment:
Last Closed: 2019-11-18 14:52:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift openshift-ansible pull 11976 0 'None' closed Bug 1643397: Fix satellite subscription registration 2021-01-12 06:18:09 UTC
Red Hat Product Errata RHBA-2019:3817 0 None None None 2019-11-18 14:52:18 UTC

Description broskos 2018-10-26 07:48:54 UTC
Description of problem:
The rhel_subscribe task in openshift-ansible does not work correctly with Satellite.

Satellite requires that the katello-ca.rpm be installed prior to satellite registration, the task in the playbook tries to install the katello-ca.rpm at the end of the task.  

here is an example patch that I found fixes this issue for satellite while preserving the cdn registration functions:
https://github.com/broskos/openshift-ansible/commit/c8c1bf591e822174aedf1d8389e8c44b9135b197#diff-1e7b37efed8aecff09358fe8a0c2a15e

Version-Release number of selected component (if applicable):
release-3.10
release-3.11

How reproducible:
always

Steps to Reproduce:
set the 3 required variables
rhsub_ak: ocp311
rhsub_orgid: brentandkrysti
rhsub_server: satellite6.home.brentandkrysti.com

run the openshift-ansible installer
Actual results:
registration fails

Expected results:
registration succeeds


Additional info:


Description of problem:

Version-Release number of the following components:
rpm -q openshift-ansible
rpm -q ansible
ansible --version

How reproducible:

Steps to Reproduce:
1.
2.
3.

Actual results:
Please include the entire output from the last TASK line through the end of output if an error is generated

Expected results:

Additional info:
Please attach logs from ansible-playbook with the -vvv flag

Comment 1 Michael Gugino 2018-11-29 20:28:52 UTC
This can probably be fixed in 3.11 and be backported to various releases.

Comment 2 Scott Dodson 2019-02-15 21:20:41 UTC
Thanks for the code reference however there appear to be no active cases related to this bug. As such we're closing this bug in order to focus on bugs that are still tied to active customer cases. Please re-open this bug if you feel it was closed in error or a new active case is attached.

We'd also be willing to accept a pull request too.

Comment 5 Johnny Liu 2019-11-05 11:37:52 UTC
Verified this bug with openshift-ansible-3.11.154-1.git.0.7a11cbe.el7.noarch, and PASS.

$ ansible-playbook -i /tmp/qe-inventory-host-file /usr/share/ansible/openshift-ansible/playbooks/byo/rhel_subscribe.yml -vv
<--snip-->
PLAY [Subscribe hosts, update repos and update OS packages] **********************************************************************************************************

TASK [Gathering Facts] ***********************************************************************************************************************************************
task path: /usr/share/ansible/openshift-ansible/playbooks/byo/rhel_subscribe.yml:4
ok: [ci-vm-10-0-151-156.hosted.upshift.rdu2.redhat.com]
META: ran handlers

TASK [rhel_subscribe : fail] *****************************************************************************************************************************************
task path: /usr/share/ansible/openshift-ansible/roles/rhel_subscribe/tasks/main.yml:2
skipping: [ci-vm-10-0-151-156.hosted.upshift.rdu2.redhat.com] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [rhel_subscribe : Install Red Hat Subscription manager] *********************************************************************************************************
task path: /usr/share/ansible/openshift-ansible/roles/rhel_subscribe/tasks/main.yml:6
ok: [ci-vm-10-0-151-156.hosted.upshift.rdu2.redhat.com] => {"attempts": 1, "changed": false, "msg": "", "rc": 0, "results": ["subscription-manager-1.24.13-3.el7_7.x86_64 providing subscription-manager is already installed"]}

TASK [rhel_subscribe : Is host already registered?] ******************************************************************************************************************
task path: /usr/share/ansible/openshift-ansible/roles/rhel_subscribe/tasks/main.yml:13
ok: [ci-vm-10-0-151-156.hosted.upshift.rdu2.redhat.com] => {"changed": false, "cmd": ["subscription-manager", "version"], "delta": "0:00:01.155877", "end": "2019-11-05 06:32:09.011204", "rc": 0, "start": "2019-11-05 06:32:07.855327", "stderr": "", "stderr_lines": [], "stdout": "server type: This system is currently not registered.\nsubscription management server: 2.9.17-1\nsubscription management rules: 5.37\nsubscription-manager: 1.24.13-3.el7_7", "stdout_lines": ["server type: This system is currently not registered.", "subscription management server: 2.9.17-1", "subscription management rules: 5.37", "subscription-manager: 1.24.13-3.el7_7"]}

TASK [rhel_subscribe : Satellite preparation] ************************************************************************************************************************
task path: /usr/share/ansible/openshift-ansible/roles/rhel_subscribe/tasks/satellite.yml:2
 [WARNING]: Consider using the yum, dnf or zypper module rather than running rpm.  If you need to use command because yum, dnf or zypper is insufficient you can add
warn=False to this command task or set command_warnings=False in ansible.cfg to get rid of this message.

fatal: [ci-vm-10-0-151-156.hosted.upshift.rdu2.redhat.com]: FAILED! => {"changed": true, "cmd": ["rpm", "-Uvh", "http://satellite6.home.brentandkrysti.com/pub/katello-ca-consumer-latest.noarch.rpm"], "delta": "0:00:00.184275", "end": "2019-11-05 06:32:09.616389", "msg": "non-zero return code", "rc": 1, "start": "2019-11-05 06:32:09.432114", "stderr": "curl: (6) Could not resolve host: satellite6.home.brentandkrysti.com; Unknown error\nerror: skipping http://satellite6.home.brentandkrysti.com/pub/katello-ca-consumer-latest.noarch.rpm - transfer failed", "stderr_lines": ["curl: (6) Could not resolve host: satellite6.home.brentandkrysti.com; Unknown error", "error: skipping http://satellite6.home.brentandkrysti.com/pub/katello-ca-consumer-latest.noarch.rpm - transfer failed"], "stdout": "Retrieving http://satellite6.home.brentandkrysti.com/pub/katello-ca-consumer-latest.noarch.rpm", "stdout_lines": ["Retrieving http://satellite6.home.brentandkrysti.com/pub/katello-ca-consumer-latest.noarch.rpm"]}
<--snip-->


The katello-ca rpm package is installed prior to satellite registration (the failure is because no existing Satellite server in my testing env)

Comment 7 errata-xmlrpc 2019-11-18 14:52:08 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, 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-2019:3817


Note You need to log in before you can comment on or make changes to this bug.