From d3cab9907b57e320b2110914d84c78a92131412c Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Fri, 8 Nov 2024 15:06:00 -0500 Subject: [PATCH] Support the dnf5 package manager We are adding support for Fedora 41 soon in cisagov/skeleton-ansible-role#207, and that release only supports dnf5, so we need to support it. --- tasks/dnf5.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tasks/dnf5.yml diff --git a/tasks/dnf5.yml b/tasks/dnf5.yml new file mode 100644 index 0000000..24d8f9e --- /dev/null +++ b/tasks/dnf5.yml @@ -0,0 +1,28 @@ +--- +- name: Upgrade all packages + block: + # TODO: Remove the following block when that becomes possible. + # See #64 for more details. + - name: Upgrade the kernel-core package separately on Fedora + when: ansible_distribution == "Fedora" + block: + - name: Update package cache (Fedora) + ansible.builtin.dnf5: + update_cache: true + - name: Upgrade the kernel-core package separately (Fedora) + ansible.builtin.dnf5: + name: "{{ item }}" + # ansible-lint generates a warning that "package installs + # should not use latest" here, but this is one place where + # we want to use it. + state: latest # noqa package-latest + loop: + - kernel-core + - name: Upgrade all packages + ansible.builtin.dnf5: + name: "*" + # ansible-lint generates a warning that "package installs + # should not use latest" here, but this is one place where we + # want to use it. + state: latest # noqa package-latest + update_cache: true