Skip to content

Commit

Permalink
common: Fix Fedora 41 DNF5 support.
Browse files Browse the repository at this point in the history
Fix #96
  • Loading branch information
JGoutin committed Nov 14, 2024
1 parent 8049f45 commit 6624764
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
22 changes: 16 additions & 6 deletions roles/common/tasks/dnf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,22 @@
value: "{{ ((common_os_hardening_localpkg_gpgcheck | bool) and (common_os_hardening | bool)) | ternary('1', '0') }}"
when: item.when | default(true)

- name: Ensure Netdata is installed
block:
- name: Ensure python3-libdnf5 is present
ansible.builtin.dnf:
state: present
name: python3-libdnf5
install_weak_deps: false
retries: 3
delay: 0.1
register: _
until: _ is successful
rescue:
- name: Ensure python3-libdnf5 is present using CLI
ansible.builtin.command: dnf install python3-libdnf5 -y
changed_when: false

- name: Ensure DNF automatic and DNF system upgrade are installed
ansible.builtin.dnf:
state: present
Expand Down Expand Up @@ -167,9 +183,3 @@
- /usr/local/sbin/dnf-automatic-restart
- /etc/systemd/system/dnf-automatic-install.service.d/dnf-automatic-restart.conf
- /etc/systemd/system/dnf-automatic-install.service.d/

- name: Ensure previous "dnf-automatic-install" configuration is disabled
ansible.builtin.systemd:
name: dnf-automatic-install.timer
enabled: false
state: stopped
8 changes: 4 additions & 4 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
- name: PAM configuration
ansible.builtin.include_tasks: pam.yml

- name: DNF configuration
ansible.builtin.include_tasks: dnf.yml
when: not (_ostree | bool)

- name: Auditd configuration
ansible.builtin.include_tasks: audit.yml

Expand All @@ -43,10 +47,6 @@
- name: Boot configuration
ansible.builtin.include_tasks: grub.yml

- name: DNF configuration
ansible.builtin.include_tasks: dnf.yml
when: not (_ostree | bool)

- name: FS-Cache configuration
ansible.builtin.include_tasks: fs_cache.yml
when: common_fs_cache | bool
Expand Down

0 comments on commit 6624764

Please sign in to comment.