Update 'reboot_check.yml'

This commit is contained in:
Jeffrey Serio 2023-05-06 20:36:49 +00:00
parent 3f6b3cbb9f
commit f1d68d12af
1 changed files with 0 additions and 18 deletions

View File

@ -7,24 +7,6 @@
become: true
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)
ansible.builtin.shell:
cmd: /bin/needs-restarting -r