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 3
3
hosts : overcloud
4
4
become : yes
5
5
gather_facts : true
6
-
7
6
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
13
19
when :
14
20
- ansible_facts['distribution'] == 'Rocky'
15
21
- ansible_facts['distribution_major_version'] == '9'
You can’t perform that action at this time.
0 commit comments