feat: add reboot task for server after package updates in yum_updates.yaml
This commit is contained in:
@@ -21,6 +21,12 @@
|
|||||||
path: /var/run/needs-restarting
|
path: /var/run/needs-restarting
|
||||||
register: reboot_required_file
|
register: reboot_required_file
|
||||||
|
|
||||||
|
- name: Reboot the server if required
|
||||||
|
ansible.builtin.reboot:
|
||||||
|
msg: "System is going down for reboot after package updates."
|
||||||
|
when: reboot_check.rc == 1 # needs-restarting -r returns 1 if a reboot is needed
|
||||||
|
|
||||||
|
|
||||||
# - name: Reboot if required
|
# - name: Reboot if required
|
||||||
# ansible.builtin.reboot:
|
# ansible.builtin.reboot:
|
||||||
# reboot_timeout: 120 # Adjust timeout as needed
|
# reboot_timeout: 120 # Adjust timeout as needed
|
||||||
|
|||||||
Reference in New Issue
Block a user