Merge "Copy generated /boot/grub2/grubenv to EFI dirs"

This commit is contained in:
Zuul 2021-07-10 13:01:12 +00:00 committed by Gerrit Code Review
commit 602039ef1d
1 changed files with 16 additions and 5 deletions

View File

@ -53,12 +53,23 @@
path: "{{ item }}"
register: grub_stat
loop:
- /boot/grub2/grub.cfg
- /boot/efi/EFI/redhat/grub.cfg
- /boot/efi/EFI/centos/grub.cfg
- /boot/efi/EFI/fedora/grub.cfg
- /boot/efi/EFI/BOOT
- /boot/efi/EFI/redhat
- /boot/efi/EFI/centos
- /boot/efi/EFI/fedora
- name: Generate grub config
command: "grub2-mkconfig -o {{ item.stat.path }}"
command: "grub2-mkconfig -o /boot/grub2/grub.cfg"
- name: Generate EFI grub config
command: "grub2-mkconfig -o {{ item.stat.path }}/grub.cfg"
when: item.stat.exists|bool
loop: "{{ grub_stat.results }}"
- name: Copy grubenv to EFI directory
copy:
remote_src: true
src: /boot/grub2/grubenv
dest: "{{ item.stat.path }}/grubenv"
when: item.stat.exists|bool
loop: "{{ grub_stat.results }}"
- name: Set reboot required fact