From c83145f9c5642bf2aa6a6c9b462f0da6f4357e6a Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Tue, 1 Nov 2022 02:23:46 -0400 Subject: [PATCH] Adjust GRUB_DIST and add UEFI regeneration Keeps the UEFI boot list cleaned and consistent --- roles/base/handlers/main.yml | 3 +++ roles/base/tasks/main.yml | 2 ++ roles/base/templates/etc/default/grub.j2 | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/roles/base/handlers/main.yml b/roles/base/handlers/main.yml index bdaf48b..acbacfa 100644 --- a/roles/base/handlers/main.yml +++ b/roles/base/handlers/main.yml @@ -34,3 +34,6 @@ - name: update grub command: update-grub + +- name: regenerate uefi entries + shell: for entry in $(efibootmgr|awk '{print $1}'|grep -Eo '[0-9]+'); do efibootmgr -b ${entry} -B; done; grub-install /dev/$(lsblk -no pkname $(findmnt -n /boot/efi|awk '{print $2}')) diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml index 71d3103..040d31e 100644 --- a/roles/base/tasks/main.yml +++ b/roles/base/tasks/main.yml @@ -260,6 +260,7 @@ - cpufrequtils - ipmitool - grub-efi + - efibootmgr - plymouth - plymouth-themes - linux-image-amd64 @@ -400,6 +401,7 @@ dest: /etc/default/grub notify: - update grub + - regenerate uefi entries # Plymouth theme - name: install PVC Plymouth theme archive diff --git a/roles/base/templates/etc/default/grub.j2 b/roles/base/templates/etc/default/grub.j2 index 4dbf3f5..fd2cfa3 100644 --- a/roles/base/templates/etc/default/grub.j2 +++ b/roles/base/templates/etc/default/grub.j2 @@ -2,7 +2,7 @@ # {{ ansible_managed }} GRUB_DEFAULT=0 GRUB_TIMEOUT=5 -GRUB_DISTRIBUTOR="Parallel Virtual Cluster (PVC) - Debian" +GRUB_DISTRIBUTOR="PVC Parallel Virtual Cluster - Debian" GRUB_CMDLINE_LINUX="{{ grub_cmdline }}" GRUB_TERMINAL_INPUT="console serial" GRUB_TERMINAL_OUTPUT="gfxterm serial"