Skip to content

Commit 6ca4114

Browse files
authored
Merge pull request #1374 from stackhpc/fix-grub-rl9-bios-mode
Prevent Grub fix from failing on non-UEFI hosts
2 parents f5ce385 + d75f329 commit 6ca4114

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

etc/kayobe/ansible/fix-grub-rl9.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@
33
hosts: overcloud
44
become: yes
55
gather_facts: true
6-
76
tasks:
8-
- name: Remove "--root-dev-only" from /boot/efi/EFI/rocky/grub.cfg
9-
ansible.builtin.replace:
10-
path: /boot/efi/EFI/rocky/grub.cfg
11-
regexp: '--root-dev-only\s?'
12-
replace: ''
7+
- block:
8+
- name: Check that /boot/efi/EFI/rocky/grub.cfg exists
9+
ansible.builtin.stat:
10+
path: /boot/efi/EFI/rocky/grub.cfg
11+
register: stat_result
12+
13+
- name: Remove "--root-dev-only" from /boot/efi/EFI/rocky/grub.cfg
14+
ansible.builtin.replace:
15+
path: /boot/efi/EFI/rocky/grub.cfg
16+
regexp: '--root-dev-only\s?'
17+
replace: ''
18+
when: stat_result.stat.exists
1319
when:
1420
- ansible_facts['distribution'] == 'Rocky'
1521
- ansible_facts['distribution_major_version'] == '9'

0 commit comments

Comments
 (0)