--- - name: Check if reboot is required ansible.builtin.stat: path: /var/run/reboot-required register: reboot_required_file - name: Perform Reboot Block when: reboot_required_file.stat.exists block: - name: Handle Proxmox Guests (Endor only) when: inventory_hostname == 'endor' ansible.builtin.shell: "pvesh create /nodes/localhost/stopall" failed_when: false - name: Reboot the machine ansible.builtin.reboot: msg: "Reboot initiated by Ansible for updates" reboot_timeout: 600 post_reboot_delay: 30 - name: Wait for Node Exporter to respond ansible.builtin.wait_for: port: 9100 host: "{{ ansible_host }}" delay: 10 timeout: 300