From 0a4a75e19e93666c817d88371b5e5ef4ec690074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hozza?= Date: Tue, 24 Jan 2023 13:08:47 +0100 Subject: [PATCH] Packer: workaround missing authselect-compat-1.2.5-2.el9_1 in RHUI repos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `authselect-compat-1.2.5-2.el9_1` package is currently missing in AWS RHUI el9 AppStream repositories, which makes `dnf upgrade` fail on RHEL-9.1. This is a RHUI-specific issue, since the package is available in CDN repos. In order to workaround the issue for now, `authselect-compat` needs to be removed as part of the upgrade in order for it to succeed. Use `--allowerasing` instead of just removing the issue, because this will ensure that `authselect-compat` will be upgraded just fine, once the issue is resolved. Fix the issue in the CI script that builds the image using Packer, as well as the Ansible playbook used by Packer to build the image. Signed-off-by: Tomáš Hozza --- .../packer/ansible/roles/common/tasks/packages.yml | 12 ++++++++++++ tools/appsre-build-worker-packer.sh | 3 +++ 2 files changed, 15 insertions(+) diff --git a/templates/packer/ansible/roles/common/tasks/packages.yml b/templates/packer/ansible/roles/common/tasks/packages.yml index 1be704d1c..5a8f58f45 100644 --- a/templates/packer/ansible/roles/common/tasks/packages.yml +++ b/templates/packer/ansible/roles/common/tasks/packages.yml @@ -24,6 +24,18 @@ # if osbuild_commit is not defined, osbuild from distribution repositories is installed when: osbuild_commit is defined +# Upgrading authselect without --allowerasing currently fails on RHEL 9.1 with RHUI repos +# https://issues.redhat.com/browse/RHUIOPS-84 +# TODO: remove this once the issue is fixed +- name: Upgrade authselect package + dnf: + name: authselect + state: latest + allowerasing: yes + register: result + retries: 5 + until: result is success + - name: Upgrade all packages package: name: "*" diff --git a/tools/appsre-build-worker-packer.sh b/tools/appsre-build-worker-packer.sh index ec4367bfb..e6946b48c 100755 --- a/tools/appsre-build-worker-packer.sh +++ b/tools/appsre-build-worker-packer.sh @@ -26,6 +26,9 @@ if [ "$ON_JENKINS" = false ]; then # see https://bugzilla.redhat.com/show_bug.cgi?id=2143282 # TODO: Remove me when the bug is fixed or we switch to 9.1 sudo dnf remove -y python-unversioned-command + # TODO: Remove once authselect-compat-1.2.5-2.el9_1.x86_64 is in el9 RHUI repos + # https://issues.redhat.com/browse/RHUIOPS-84 + sudo dnf upgrade -y --allowerasing authselect sudo dnf upgrade -y sudo dnf install -y podman jq