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

14 lines
329 B
YAML
Raw Normal View History

2023-05-25 13:48:38 +02:00
---
- name: check if system reboot is required
hosts: "{{ hosts }}"
become: yes
tasks:
- name: check if system reboot is required
become: true
stat:
path: /var/run/reboot-required
register: reboot_required
- debug:
msg: "Reboot is required"
when: reboot_required.stat.exists