Skip to content

Commit 069273d

Browse files
committed
fix:
1. Removed the notify: update grub lines from the GRUB update tasks 2. Added register variables to track if changes were made 3. Added a conditional task to run update-grub only when changes occurred 4. Removed the invalid handler definition at the end of the file
1 parent f851f55 commit 069273d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

ansible/tasks/setup-coredumps.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
when:
103103
- stage2_nix
104104
- grub_d_files.stdout == ""
105-
notify: update grub
105+
register: grub_main_updated
106106

107107
- name: Update GRUB configuration for coredump_filter in grub.d files
108108
become: yes
@@ -115,7 +115,14 @@
115115
when:
116116
- stage2_nix
117117
- grub_d_files.stdout != ""
118-
notify: update grub
118+
register: grub_d_updated
119+
120+
- name: Update GRUB after configuration changes
121+
become: yes
122+
command: update-grub
123+
when:
124+
- stage2_nix
125+
- grub_main_updated.changed or grub_d_updated.changed
119126

120127
- name: Install gdb for debugging
121128
become: yes
@@ -209,11 +216,4 @@
209216
mode: '0644'
210217
owner: root
211218
group: root
212-
when: stage2_nix
213-
214-
# Handler for updating GRUB
215-
- name: Define update grub handler
216-
become: yes
217-
command: update-grub
218-
listen: update grub
219219
when: stage2_nix

0 commit comments

Comments
 (0)