This commit is contained in:
Justin committed 2025-09-03 20:45:17 -05:00
1 parent 79df365f95
commit bee972ff5f
6 files changed
+48 -44

No files matched your search

@@ -0,0 +1,30 @@
---
- name: Check if system reboot is required
hosts: "proxmox"
become: true
serial: 1
tasks:
- name: Check if system reboot is required
become: true
ansible.builtin.stat:
path: /run/reboot-required
register: reboot_required
- name: rebooting
become: true
ansible.builtin.reboot:
reboot_timeout: 3600
when: reboot_required.stat.exists
- name: wait for server to resert
ansible.builtin.wait_for_connection:
delay: 30
timeout: 3600
when: reboot_required.stat.exists
- name: Report if reboot is required
ansible.builtin.command:
cmd: 'curl -d "Reboot was required for {{inventory_hostname}} and it was rebooted" ntfy.ki5bhv.com/server'
when: reboot_required.stat.exists