Bug 2100644

Summary: openshift-ansible FTBFS on RHEL8
Product: OpenShift Container Platform Reporter: Yaakov Selkowitz <yselkowi>
Component: InstallerAssignee: Nobody <nobody>
Installer sub component: openshift-ansible QA Contact: Gaoyun Pei <gpei>
Status: CLOSED ERRATA Docs Contact:
Severity: urgent    
Priority: urgent CC: padillon
Version: 4.11   
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 11:19:12 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:
Bug Depends On:    
Bug Blocks: 2100850    

Description Yaakov Selkowitz 2022-06-23 21:08:13 UTC
4.11 builds of openshift-ansible were stopped by https://github.com/openshift/ocp-build-data/commit/8a976dccad2bfeb73c7b63c422e986cf4146dd08 due to a build error.  However, the package is still needed for BYO RHEL (now 8).  Since we are looking to drop RHEL7 RPMs wherever possible, and it certainly makes no sense to require specifically a RHEL7 ansible host in order to configure RHEL8 worker nodes, we need to make openshift-ansible buildable on RHEL8 and reinstate the builds.

The build error that triggered this is unversioned python shebangs in scripts and modules included in openshift-ansible.  In RHEL8, /usr/bin/python is not provided by any package, and therefore packages must normally specify either python2 or python3.  While the script that checks for python shebangs also has some ability to fix them automatically, that did not work for one of the files:

** ERROR: ambiguous python shebang in /usr/share/ansible/openshift-ansible/inventory/dynamic/gcp/hosts.py: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.

This script in its current state is not compatible with Python 3, so either it needs to use 2, or be ported to 3.

Note that CI, QE, and Docs all need to be updated for using a RHEL8 ansible host (instead of RHEL7) for configuring RHEL8 worker nodes.  Also, whether RHEL8 openshift-ansible packages should be backported to stable versions where RHEL8 worker nodes are supported (4.9/4.10) should be at least discussed.

Comment 2 Yaakov Selkowitz 2022-06-23 23:28:55 UTC
CI draft changes: https://github.com/openshift/openshift-ansible/pull/12399
That will require changes to https://github.com/openshift/release/tree/master/ci-operator/config/openshift/openshift-ansible for relevant branches; assistance will be needed.
With code freeze quickly approaching, I have not attached that PR to this BZ.

Comment 4 Gaoyun Pei 2022-06-24 09:05:24 UTC
Thanks for implementing this.

Tested with the following release on RHEL-8.6:
ansible-2.9.27-1.el8ae.noarch
openshift-ansible-4.11.0-202206240216.p0.g9de1722.assembly.stream.el8.noarch.

openshift-ansible package could be installed successfully on the RHEL-8 host, both /usr/share/ansible/openshift-ansible/playbooks/scaleup.yml and /usr/share/ansible/openshift-ansible/playbooks/upgrade.yml work well on RHEL-8 host. RHEL-8 workers could be added/upgraded.

Comment 5 Gaoyun Pei 2022-06-24 09:06:43 UTC
Also filed https://bugzilla.redhat.com/show_bug.cgi?id=2100766 to request doc update on this.

Comment 8 errata-xmlrpc 2022-08-10 11:19:12 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 (Important: OpenShift Container Platform 4.11.0 bug fix and security update), 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/RHSA-2022:5069