From 86afca262fb9d2050ad16bb499f76a00514b60fa Mon Sep 17 00:00:00 2001 From: "flyingscorpio@clevo" Date: Sun, 27 Feb 2022 12:03:17 +0100 Subject: [PATCH] Run grub-mkconfig in a handler --- roles/grub/handlers/main.yml | 4 ++++ roles/grub/tasks/main.yml | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 roles/grub/handlers/main.yml diff --git a/roles/grub/handlers/main.yml b/roles/grub/handlers/main.yml new file mode 100644 index 0000000..4f4edaf --- /dev/null +++ b/roles/grub/handlers/main.yml @@ -0,0 +1,4 @@ +--- +- name: Generate grub config + become: true + command: grub-mkconfig -o /boot/grub/grub.cfg diff --git a/roles/grub/tasks/main.yml b/roles/grub/tasks/main.yml index 38c3521..57ae2e2 100644 --- a/roles/grub/tasks/main.yml +++ b/roles/grub/tasks/main.yml @@ -11,6 +11,7 @@ - name: Set confs for grub become: true + notify: Generate grub config block: - name: Set GRUB_DEFAULT to saved replace: @@ -36,7 +37,3 @@ regexp: '^#?GRUB_DISABLE_SUBMENU.+' replace: 'GRUB_DISABLE_SUBMENU=y' backup: true - -- name: Generate grub config - become: true - command: grub-mkconfig -o /boot/grub/grub.cfg