tripleo-kernel: Adding reboot_protection variable

When the role is included, the params and variables have higher
precedence than the set_fact, thus not taking the set_fact defer_reboot
into account.

Adding a reboot_protection variable that is not included when calling
the role will prevent this behavior.

Resolves: rhbz#1975240
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1975240
Change-Id: If2d9a8a21f19e4fe7699c0ac932c9801fd133474
(cherry picked from commit 39a809f9e7)
(cherry picked from commit f2caac2432)
(cherry picked from commit ce09f4b022)
(cherry picked from commit b7481fe94e)
This commit is contained in:
David Vallee Delisle 2021-08-09 11:45:01 -04:00
parent 118bf6df03
commit 7198788ea8
2 changed files with 3 additions and 0 deletions

View File

@ -23,3 +23,4 @@ tripleo_kernel_args: ""
tripleo_kernel_reboot_timeout: 3600
tripleo_kernel_post_reboot_delay: 60
tripleo_kernel_defer_reboot: false
tripleo_kernel_reboot_protection: false

View File

@ -41,6 +41,7 @@
- name: Setting defer reboot fact
set_fact:
tripleo_kernel_defer_reboot: true
tripleo_kernel_reboot_protection: true
- name: Check if the kernelargs entry is already present in the file
replace:
@ -125,6 +126,7 @@
when:
- reboot_required is defined and reboot_required
- not tripleo_kernel_defer_reboot|bool
- not tripleo_kernel_reboot_protection|bool
block:
- name: Reboot tasks
include_tasks: reboot.yaml