diff options
author | Andrea Bolognani <abologna@redhat.com> | 2022-05-31 16:51:38 +0200 |
---|---|---|
committer | Andrea Bolognani <abologna@redhat.com> | 2022-06-01 14:26:39 +0200 |
commit | cc10a9056c51d950f572377f2e443166e2959cad (patch) | |
tree | 333cf0ab2b34ba131ef9fdacebbca049ab803157 | |
parent | 0ac812d80e5766a66485022eafeaf9c9de47c27b (diff) | |
download | libvirt-ci-cc10a9056c51d950f572377f2e443166e2959cad.zip libvirt-ci-cc10a9056c51d950f572377f2e443166e2959cad.tar.gz libvirt-ci-cc10a9056c51d950f572377f2e443166e2959cad.tar.bz2 |
lcitool: Simplify EPEL installation
The epel-release package is now included in the repositories for
both CentOS Stream 9 and AlmaLinux 9, so we can simplify the
installation process.
We also enable EPEL Next on CentOS Stream 8 now, which was
previously not the case.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
3 files changed, 16 insertions, 39 deletions
diff --git a/guests/lcitool/lcitool/ansible/playbooks/update/tasks/base.yml b/guests/lcitool/lcitool/ansible/playbooks/update/tasks/base.yml index aa0f9be..538ade2 100644 --- a/guests/lcitool/lcitool/ansible/playbooks/update/tasks/base.yml +++ b/guests/lcitool/lcitool/ansible/playbooks/update/tasks/base.yml @@ -35,26 +35,15 @@ name: epel-release state: latest when: - # FIXME Modify the check once EPEL for CentOS Stream 9 exists - - (os.name == 'CentOS' and os.version != 'Stream9') or - (os.name == 'AlmaLinux' and os.version == '8') - -- block: - - name: Import EPEL GPG key - rpm_key: - state: present - key: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-9 + - os.name == 'CentOS' or os.name == 'AlmaLinux' - - name: Enable EPEL repository - package: - name: '{{ item }}' - state: latest - loop: - - https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm - - https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm +- name: Enable EPEL Next repository + package: + name: epel-next-release + state: latest when: - - (os.name == 'CentOS' and os.version == 'Stream9') or - (os.name == 'AlmaLinux' and os.version == '9') + - os.name == 'CentOS' + - os.version == 'Stream8' or os.version == 'Stream9' - name: Enable Advanced Virtualization repository package: diff --git a/guests/lcitool/lcitool/formatters.py b/guests/lcitool/lcitool/formatters.py index daf1fa6..54680c6 100644 --- a/guests/lcitool/lcitool/formatters.py +++ b/guests/lcitool/lcitool/formatters.py @@ -327,27 +327,16 @@ class DockerfileFormatter(Formatter): # Some of the packages we need are not part of CentOS proper # and are only available through EPEL - if osversion in ["8", "Stream8"]: - epel_pkgs = ["epel-release"] - elif osversion in ["9", "Stream9"]: - base_url = "https://dl.fedoraproject.org/pub/epel/" - rpm_suffix = "-latest-9.noarch.rpm" - - epel_pkgs = [ - base_url + "epel-release" + rpm_suffix, - base_url + "epel-next-release" + rpm_suffix - ] - - # contrary to other one-liner packaging command invocations - # we now have a multiline one and to ensure the right - # formatting, we need to inject a new keyword to the varmap - varmap["epel_pkgs"] = self._align(facts["packaging"]["command"], - epel_pkgs) - commands.extend([ - "{nosync}{packaging_command} install -y {epel_pkgs}", + "{nosync}{packaging_command} install -y epel-release", ]) + # For CentOS Stream, we want EPEL Next as well + if osversion in ["Stream8", "Stream9"]: + commands.extend([ + "{nosync}{packaging_command} install -y epel-next-release", + ]) + commands.extend(["{nosync}{packaging_command} install -y {pkgs}"]) # openSUSE doesn't seem to have a convenient way to remove all diff --git a/guests/lcitool/tests/data/manifest/out/ci/containers/centos-stream-9.Dockerfile b/guests/lcitool/tests/data/manifest/out/ci/containers/centos-stream-9.Dockerfile index cc4aefd..93146c8 100644 --- a/guests/lcitool/tests/data/manifest/out/ci/containers/centos-stream-9.Dockerfile +++ b/guests/lcitool/tests/data/manifest/out/ci/containers/centos-stream-9.Dockerfile @@ -3,9 +3,8 @@ FROM quay.io/centos/centos:stream9 RUN dnf distro-sync -y && \ dnf install 'dnf-command(config-manager)' -y && \ dnf config-manager --set-enabled -y crb && \ - dnf install -y \ - https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \ - https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm && \ + dnf install -y epel-release && \ + dnf install -y epel-next-release && \ dnf install -y \ ca-certificates \ gcc \ |