Update 'reboot_check.yml'
This commit is contained in:
parent
3f6b3cbb9f
commit
f1d68d12af
|
@ -7,24 +7,6 @@
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Check if reboot is required (Debian)
|
|
||||||
ansible.builtin.stat:
|
|
||||||
path: /var/run/needrestart
|
|
||||||
register: needrestart
|
|
||||||
when: ansible_facts["os_family"] == "Debian"
|
|
||||||
|
|
||||||
- name: Reboot the machine (Wait for 5 minutes)
|
|
||||||
ansible.builtin.reboot:
|
|
||||||
reboot_timeout: 300
|
|
||||||
when:
|
|
||||||
- needrestart.stat.exists is defined
|
|
||||||
- needrestart.stat.exists
|
|
||||||
- ansible_facts["os_family"] == "Debian"
|
|
||||||
ignore_errors: true
|
|
||||||
changed_when:
|
|
||||||
- needrestart.stat.exists is defined
|
|
||||||
- needrestart.stat.exists
|
|
||||||
|
|
||||||
- name: Check if reboot is required (RHEL-compatible)
|
- name: Check if reboot is required (RHEL-compatible)
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: /bin/needs-restarting -r
|
cmd: /bin/needs-restarting -r
|
||||||
|
|
Loading…
Reference in New Issue
Block a user