christianlempa-boilerplates/ansible/maintenance/maint-reboot-required.yaml

17 lines
416 B
YAML

---
- name: Check if system reboot is required
hosts: "{{ my_hosts | d([]) }}"
become: true
tasks:
- name: Check if system reboot is required
become: true
ansible.builtin.stat:
path: /var/run/reboot-required
register: reboot_required
- name: Report if reboot is required
ansible.builtin.debug:
msg: "Reboot is required"
when: reboot_required.stat.exists