From ced0da7bd11d254a821911e7ae6500949cc9c2ee Mon Sep 17 00:00:00 2001 From: Sandwich Date: Sat, 21 Feb 2026 11:46:57 +0100 Subject: [PATCH] fix(bootstrap): detect kernel package name for dnf family reinstall step --- roles/bootstrap/tasks/_dnf_family.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/roles/bootstrap/tasks/_dnf_family.yml b/roles/bootstrap/tasks/_dnf_family.yml index 7e4ba32..d60d78f 100644 --- a/roles/bootstrap/tasks/_dnf_family.yml +++ b/roles/bootstrap/tasks/_dnf_family.yml @@ -33,7 +33,15 @@ register: bootstrap_dnf_extra_result changed_when: bootstrap_dnf_extra_result.rc == 0 - - name: Reinstall kernel core - ansible.builtin.command: "{{ chroot_command }} dnf reinstall -y kernel-core" + - name: Detect installed kernel package name + ansible.builtin.command: "{{ chroot_command }} rpm -q kernel-core" + register: bootstrap_dnf_kernel_check + changed_when: false + failed_when: false + + - name: Reinstall kernel package + vars: + _kernel_pkg: "{{ 'kernel-core' if bootstrap_dnf_kernel_check.rc == 0 else 'kernel' }}" + ansible.builtin.command: "{{ chroot_command }} dnf reinstall -y {{ _kernel_pkg }}" register: bootstrap_dnf_kernel_result changed_when: bootstrap_dnf_kernel_result.rc == 0