Skip to content

Commit 4e4d40b

Browse files
authored
Add Alma and Rocky Linux as supported host OSes (#1348)
These two distributions are essentially what CentOS was pre-Stream, so they should generally be compatible as well. They are documented as "best effort" support though since I don't think we'll be running them in CI. For Alma, Ansible does not correctly detect the python interpreter so we need to explicitly override it on calls to ansible-playbook. We can't do it in a config file because it's explicitly set in the metal3-dev-env inventory, so we need to use a method that will take precedence over that. This workaround can be removed once Ansible has proper support for Python detection on Alma.
1 parent ddfc265 commit 4e4d40b

File tree

6 files changed

+17
-1
lines changed

6 files changed

+17
-1
lines changed

01_install_requirements.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ case $DISTRO in
5151
sudo dnf install -y network-scripts
5252
if [[ $DISTRO == "centos8" ]]; then
5353
echo "CentOS is not supported anymore. Please switch to CentOS Stream / RHEL / Rocky Linux"
54+
fi
55+
if [[ $DISTRO == "centos8" || $DISTRO == "almalinux8" || $DISTRO == "rocky8" ]]; then
5456
sudo dnf -y install epel-release dnf --enablerepo=extras
5557
elif [[ $DISTRO == "rhel8" ]]; then
5658
# Enable EPEL for python3-passlib and python3-bcrypt required by metal3-dev-env
@@ -104,6 +106,7 @@ ANSIBLE_FORCE_COLOR=true ansible-playbook \
104106
-e "virthost=$HOSTNAME" \
105107
-e "go_version=1.18.3" \
106108
-e "GOARCH=$GOARCH" \
109+
$ALMA_PYTHON_OVERRIDE \
107110
-i vm-setup/inventory.ini \
108111
-b -vvv vm-setup/install-package-playbook.yml
109112
popd

02_configure_host.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ ansible-playbook \
119119
-e "worker_hostname_format=$WORKER_HOSTNAME_FORMAT" \
120120
-e "libvirt_arch=$(uname -m)" \
121121
-e "enable_vnc_console=$VNC_CONSOLE" \
122+
$ALMA_PYTHON_OVERRIDE \
122123
-i ${VM_SETUP_PATH}/inventory.ini \
123124
-b -vvv ${VM_SETUP_PATH}/setup-playbook.yml
124125

@@ -249,6 +250,7 @@ ANSIBLE_FORCE_COLOR=true ansible-playbook \
249250
-e "baremetal_interface=$BAREMETAL_NETWORK_NAME" \
250251
-e "{provisioning_host_ports: [80, ${LOCAL_REGISTRY_PORT}, 8000, ${INSTALLER_PROXY_PORT}]}" \
251252
-e "vbmc_port_range=$VBMC_BASE_PORT:$VBMC_MAX_PORT" \
253+
$ALMA_PYTHON_OVERRIDE \
252254
-i ${VM_SETUP_PATH}/inventory.ini \
253255
-b -vvv ${VM_SETUP_PATH}/firewall.yml
254256

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ other components of OpenShift via support for a baremetal platform type.
1313
# Pre-requisites
1414

1515
- CentOS 8 or RHEL 8 host
16+
- Alma and Rocky Linux 8 are also supported on a best effort basis
1617
- file system that supports d_type (see [Troubleshooting](#Troubleshooting) section for more information)
1718
- ideally on a bare metal host with at least 64G of RAM
1819
- run as a user with passwordless sudo access

common.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,3 +379,12 @@ export TEST_CUSTOM_MAO=${TEST_CUSTOM_MAO:-false}
379379
# Set to configure bootstrap VM baremetal network with static IP
380380
# (Currently this just expects a non-empty value, the IP is fixed to .9)
381381
export ENABLE_BOOTSTRAP_STATIC_IP=${ENABLE_BOOTSTRAP_STATIC_IP:-}
382+
383+
# TODO(bnemec): Once https://github.com/ansible/ansible/pull/75537 merges this
384+
# can be removed.
385+
ALMA_PYTHON_OVERRIDE=
386+
source /etc/os-release
387+
export DISTRO="${ID}${VERSION_ID%.*}"
388+
if [[ $DISTRO == "almalinux8" || $DISTRO == "rocky8" ]]; then
389+
ALMA_PYTHON_OVERRIDE="-e ansible_python_interpreter=/usr/libexec/platform-python"
390+
fi

host_cleanup.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ ansible-playbook \
2828
-e "virthost=$HOSTNAME" \
2929
-e "manage_baremetal=$MANAGE_BR_BRIDGE" \
3030
-e "nodes_file=$NODES_FILE" \
31+
$ALMA_PYTHON_OVERRIDE \
3132
-i ${VM_SETUP_PATH}/inventory.ini \
3233
-b -vvv ${VM_SETUP_PATH}/teardown-playbook.yml
3334

validation.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function early_either_validation() {
1616
fi
1717

1818
# Check OS
19-
if [[ ! $(awk -F= '/^ID=/ { print $2 }' /etc/os-release | tr -d '"') =~ ^(centos|rhel)$ ]]; then
19+
if [[ ! $(awk -F= '/^ID=/ { print $2 }' /etc/os-release | tr -d '"') =~ ^(centos|rhel|almalinux|rocky)$ ]]; then
2020
error "Unsupported OS"
2121
exit 1
2222
fi

0 commit comments

Comments
 (0)