From c2e1960eee4605ab8806d732062223e1cf5cce56 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Tue, 4 Mar 2025 11:19:08 -0800 Subject: [PATCH] Fix CI for Fedora 41 (dnf 5) See https://pagure.io/fedora-project-config/issue/340 and https://github.com/ansible/ansible/issues/84206 . We need to force install python3-libdnf5 or ansible can't manage packages. Signed-off-by: Adam Williamson --- ci/dnf-dependency.yaml | 16 ++++++++++++++++ ci/perl.yaml | 3 +++ ci/tox.yaml | 3 +++ 3 files changed, 22 insertions(+) create mode 100644 ci/dnf-dependency.yaml diff --git a/ci/dnf-dependency.yaml b/ci/dnf-dependency.yaml new file mode 100644 index 00000000..85201cea --- /dev/null +++ b/ci/dnf-dependency.yaml @@ -0,0 +1,16 @@ +# See https://github.com/ansible/ansible/issues/84206 for the background on this +# When the server is on ansible >= 2.19 things should just work, but ours are +# not (RHEL 9 has 2.14, RHEL 8 has 2.15, as I write this) + +- name: Ensure that python3-libdnf5 is installed + block: + - name: Check whether python3-libdnf5 is installed + ansible.builtin.command: "rpm -q python3-libdnf5" + register: p3dnf5 + failed_when: "1 != 1" + changed_when: "1 != 1" + check_mode: no + + - name: Install python3-libdnf5 with direct dnf command + ansible.builtin.command: "dnf -y install python3-libdnf5" + when: "p3dnf5.rc != 0" diff --git a/ci/perl.yaml b/ci/perl.yaml index bf0b9d37..bbe26329 100644 --- a/ci/perl.yaml +++ b/ci/perl.yaml @@ -1,5 +1,8 @@ - hosts: all tasks: + - name: Include dnf dependency workaround task + ansible.builtin.include_tasks: + file: dnf-dependency.yaml - name: Install required packages package: name: ['os-autoinst', 'perl-Test-Strict', 'perl-Test-Harness', 'perl-JSON', 'perl-REST-Client', 'perl-Code-TidyAll'] diff --git a/ci/tox.yaml b/ci/tox.yaml index 288617a5..9333b3a6 100644 --- a/ci/tox.yaml +++ b/ci/tox.yaml @@ -1,5 +1,8 @@ - hosts: all tasks: + - name: Include dnf dependency workaround task + ansible.builtin.include_tasks: + file: dnf-dependency.yaml - name: Ensure tox is installed include_role: name: ensure-tox