when:os | lower != "fedora" and os | lower != "almalinux" and os | lower != "rhel8" and os | lower != "rhel9"
block:
- name:Add commandline information to grub config
lineinfile:
dest:/mnt/etc/default/grub
regexp:^GRUB_CMDLINE_LINUX_DEFAULT=
line:'GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3"'
- name:Change Grub time
lineinfile:
dest:/mnt/etc/default/grub
regexp:^GRUB_TIMEOUT=
line:'GRUB_TIMEOUT=0'
- name:Configure Bootloader
block:
- name:Install Bootloader
command:arch-chroot /mnt {% if os | lower != "archlinux" and os | lower != "debian11" and os | lower != "debian12" %}/usr/sbin/efibootmgr -c -L '{{ os }}' -d "{{ install_drive }}" -wwp 1 -l '\efi\EFI\{{ os }}\shimx64.efi'{% else %}/usr/sbin/grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id={{ os }}{% endif %}
- name:Generate grub config
command:arch-chroot /mnt {% if os | lower != "archlinux" and os | lower != "debian11" and os | lower != "debian12" %}/usr/sbin/grub2-mkconfig -o /boot/efi/EFI/{{ os }}/grub.cfg{% else %}/usr/sbin/grub-mkconfig -o /boot/grub/grub.cfg{% endif %}
- name:Extra Configuration
when:os | lower != "archlinux"
block:
- name:Append lines to vimrc
lineinfile:
path:"{{ '/mnt/etc/vim/vimrc' if os|lower == 'debian11' or os|lower == 'debian12' else '/mnt/etc/vimrc' }}"