File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 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'
You can’t perform that action at this time.
0 commit comments