2023-05-25 13:48:38 +02:00
|
|
|
---
|
|
|
|
- name: check if system reboot is required
|
2024-02-23 12:19:48 +01:00
|
|
|
hosts: "{{ my_hosts | d([]) }}"
|
2024-03-03 16:16:22 +01:00
|
|
|
become: true
|
2024-03-03 16:34:29 +01:00
|
|
|
|
2023-05-25 13:48:38 +02:00
|
|
|
tasks:
|
|
|
|
- name: check if system reboot is required
|
|
|
|
become: true
|
2024-02-24 11:56:25 +01:00
|
|
|
ansible.builtin.stat:
|
2023-05-25 13:48:38 +02:00
|
|
|
path: /var/run/reboot-required
|
|
|
|
register: reboot_required
|
2024-03-03 16:34:29 +01:00
|
|
|
|
2024-03-03 16:43:55 +01:00
|
|
|
- name: Report if reboot is required
|
|
|
|
ansible.builtin.debug:
|
2023-05-25 13:48:38 +02:00
|
|
|
msg: "Reboot is required"
|
2024-02-22 19:01:59 +01:00
|
|
|
when: reboot_required.stat.exists
|