Skip to content

Commit

Permalink
Merge pull request #1374 from stackhpc/fix-grub-rl9-bios-mode
Browse files Browse the repository at this point in the history
Prevent Grub fix from failing on non-UEFI hosts
  • Loading branch information
priteau authored Nov 13, 2024
2 parents f5ce385 + d75f329 commit 6ca4114
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions etc/kayobe/ansible/fix-grub-rl9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
hosts: overcloud
become: yes
gather_facts: true

tasks:
- name: Remove "--root-dev-only" from /boot/efi/EFI/rocky/grub.cfg
ansible.builtin.replace:
path: /boot/efi/EFI/rocky/grub.cfg
regexp: '--root-dev-only\s?'
replace: ''
- block:
- name: Check that /boot/efi/EFI/rocky/grub.cfg exists
ansible.builtin.stat:
path: /boot/efi/EFI/rocky/grub.cfg
register: stat_result

- name: Remove "--root-dev-only" from /boot/efi/EFI/rocky/grub.cfg
ansible.builtin.replace:
path: /boot/efi/EFI/rocky/grub.cfg
regexp: '--root-dev-only\s?'
replace: ''
when: stat_result.stat.exists
when:
- ansible_facts['distribution'] == 'Rocky'
- ansible_facts['distribution_major_version'] == '9'

0 comments on commit 6ca4114

Please sign in to comment.