ensure grub installed
Marco Andronaco andronacomarco@gmail.com
Sat, 11 Feb 2023 11:44:46 +0100
2 files changed,
14 insertions(+),
0 deletions(-)
M
group_vars/all/vars.yml
→
group_vars/all/vars.yml
@@ -4,5 +4,6 @@ - btop
- firefox - tmux - git + - linux-lts username: "{{ ansible_user }}"
M
tasks/essential.yml
→
tasks/essential.yml
@@ -64,3 +64,16 @@ - filesystems
- fsck mkinitcpio_force_create: false mkinitcpio_disable_fallback_preset: true + +- name: Check to see if grub has been configured + stat: path=/boot/grub/grub.cfg + register: grub_config + +- name: Write grub configuration file + command: grub-mkconfig -o /boot/grub/grub.cfg + when: grub_config.stat.exists == False + +- name: Write grub to MBR + command: grub-install /dev/vda1 + when: grub_config.stat.exists == False +