Skip to content

Commit 383b992

Browse files
committed
Check if boot_file_entry_present is defined before using it
The "Reboot block"'s when statements are just copied to every task in the block, so each statement needs to be able to be evaluated. Both earlier blocks that set the var could be skipped, check it's defined before using it. Signed-off-by: James Slagle <[email protected]>
1 parent 98e1a95 commit 383b992

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

roles/edpm_kernel/tasks/kernelargs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
when:
137137
- set_kernel_args is defined
138138
- set_kernel_args is true
139-
- ansible_local.bootc
139+
- ansible_local.bootc is defined and ansible_local.bootc
140140
block:
141141

142142
- name: Check if the kernelargs entry is already present in the file
@@ -213,10 +213,10 @@
213213
- name: Reboot tasks
214214
ansible.builtin.include_tasks: reboot.yaml
215215
when:
216-
- not boot_file_entry_present
216+
- boot_file_entry_present is defined and not boot_file_entry_present
217217

218218
- name: Skipping reboot for deployed node
219219
ansible.builtin.debug: # noqa: no-handler
220220
msg: "Reboot is skipped for kernel arg change, user has to plan the reboot with migration and downtime"
221221
when:
222-
- boot_file_entry_present
222+
- boot_file_entry_present is defined and boot_file_entry_present

0 commit comments

Comments
 (0)