File tree Expand file tree Collapse file tree 7 files changed +56
-6
lines changed
Expand file tree Collapse file tree 7 files changed +56
-6
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,15 @@ when to reboot the managed host. The role will return the variable
109109` kernel_settings_reboot_required ` (see below) with a value of ` true ` to indicate
110110that some change has occurred which needs a reboot to take effect.
111111
112+ ### kernel_settings_transactional_update_reboot_ok
113+
114+ This variable is used to handle reboots required by transactional updates.
115+ If a transactional update requires a reboot, the role will proceed with the
116+ reboot if ` kernel_settings_transactional_update_reboot_ok ` is set to ` true ` . If set
117+ to ` false ` , the role will notify the user that a reboot is required, allowing
118+ for custom handling of the reboot requirement. If this variable is not set,
119+ the role will fail to ensure the reboot requirement is not overlooked.
120+
112121### Variables Exported by the Role
113122
114123The role will export the following variables:
Original file line number Diff line number Diff line change @@ -47,3 +47,11 @@ kernel_settings_purge: false
4747# some changes will require the managed host to be rebooted in order to be
4848# applied, and will set kernel_settings_reboot_required: true
4949kernel_settings_reboot_ok : false
50+
51+ # This variable is used to handle reboots required by transactional updates.
52+ # If a transactional update requires a reboot, the role will proceed with the
53+ # reboot if `kernel_settings_transactional_update_reboot_ok` is set to `true`. If set
54+ # to `false`, the role will notify the user that a reboot is required, allowing
55+ # for custom handling of the reboot requirement. If this variable is not set,
56+ # the role will fail to ensure the reboot requirement is not overlooked.
57+ kernel_settings_transactional_update_reboot_ok : null
Original file line number Diff line number Diff line change 88 state : present
99 use : " {{ (__kernel_settings_is_ostree | d(false)) |
1010 ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
11+ register : kernel_settings_package_result
12+
13+ - name : Handle reboot for transactional update systems
14+ when :
15+ - __kernel_settings_is_transactional | d(false)
16+ - kernel_settings_package_result is changed
17+ block :
18+ - name : Notify user that reboot is needed to apply changes
19+ debug :
20+ msg : >
21+ Reboot required to apply changes due to transactional updates.
22+
23+ - name : Reboot transactional update systems
24+ reboot :
25+ msg : Rebooting the system to apply transactional update changes.
26+ when : kernel_settings_transactional_update_reboot_ok | bool
27+
28+ - name : Fail if reboot is needed and not set
29+ fail :
30+ msg : >
31+ Reboot is required but not allowed. Please set
32+ 'kernel_settings_transactional_update_reboot_ok' to proceed.
33+ when :
34+ - kernel_settings_transactional_update_reboot_ok is none
1135
1236- name : Ensure required services are enabled and started
1337 service :
Original file line number Diff line number Diff line change 1717 set_fact :
1818 __kernel_settings_is_ostree : " {{ __ostree_booted_stat.stat.exists }}"
1919
20+ - name : Determine if system is transactional update and set flag
21+ when : not __kernel_settings_is_transactional is defined
22+ block :
23+ - name : Check if transactional-update exists in /sbin
24+ stat :
25+ path : /sbin/transactional-update
26+ register : __transactional_update_stat
27+
28+ - name : Set flag if transactional-update exists
29+ set_fact :
30+ __kernel_settings_is_transactional : " {{ __transactional_update_stat.stat.exists }}"
31+
2032- name : Set platform/version specific variables
2133 include_vars : " {{ lookup('first_found', ffparams) }}"
2234 vars :
Original file line number Diff line number Diff line change 1+ ---
2+ __kernel_settings_test_python_pkgs : ["python", "python-configobj"]
3+ __kernel_settings_test_python_cmd : python3
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments