add conditional reboot on kernel upgrades
This commit is contained in:
1 parent
2f1714b70b
commit
8d0bb7b166
1 file changed
+12
-1
@@ -26,7 +26,7 @@
|
|||||||
state: present
|
state: present
|
||||||
update_cache: true
|
update_cache: true
|
||||||
become: true
|
become: true
|
||||||
#
|
|
||||||
# - name: Enable unattended-upgrades
|
# - name: Enable unattended-upgrades
|
||||||
# ansible.builtin.copy:
|
# ansible.builtin.copy:
|
||||||
# dest: /etc/apt/apt.conf.d/20auto-upgrades
|
# dest: /etc/apt/apt.conf.d/20auto-upgrades
|
||||||
@@ -35,3 +35,14 @@
|
|||||||
# APT::Periodic::Unattended-Upgrade "1";
|
# APT::Periodic::Unattended-Upgrade "1";
|
||||||
# mode: "0644"
|
# mode: "0644"
|
||||||
# when: ansible_facts['os_family'] == "Debian"
|
# when: ansible_facts['os_family'] == "Debian"
|
||||||
|
|
||||||
|
- name: Check if reboot is required
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: /var/run/reboot-required
|
||||||
|
register: reboot_required_file
|
||||||
|
|
||||||
|
- name: Reboot host if necessary
|
||||||
|
ansible.builtin.reboot:
|
||||||
|
post_reboot_delay: 10
|
||||||
|
become: true
|
||||||
|
when: reboot_required_file.stat.exists
|
||||||
Reference in new issue
Block a user