2
0
Files
Ansible/Maintenance/maint-reboot-required.yaml
2024-06-17 08:41:13 +02:00

20 lines
443 B
YAML

---
- name: Check if system reboot is required
hosts: all
become: yes
become_user: root
tasks:
- name: Check if a reboot is required
register: reboot
ansible.builtin.stat:
path: /var/run/reboot-required
- name: Reboot machine
ansible.builtin.reboot:
when: reboot.stat.exists
- name: Wait for systems to become reachable
wait_for_connection:
delay: 5
timeout: 300