refactor: update reboot task to use conditional check for reboot requirement in linux_updates.yaml
This commit is contained in:
+6
-4
@@ -37,10 +37,12 @@
|
|||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
autoremove: yes
|
autoremove: yes
|
||||||
|
|
||||||
- name: Reboot when packages were updated
|
- name: Reboot if required
|
||||||
reboot:
|
ansible.builtin.reboot:
|
||||||
post_reboot_delay: 60
|
reboot_timeout: 600 # Adjust timeout as needed
|
||||||
when: apt_update_status.changed
|
when: reboot_required_file.stat.exists
|
||||||
|
vars:
|
||||||
|
reboot_required_file: /var/run/reboot-required
|
||||||
|
|
||||||
#- hosts: apkhosts
|
#- hosts: apkhosts
|
||||||
# tasks:
|
# tasks:
|
||||||
|
|||||||
Reference in New Issue
Block a user