Files
ansible/roles/reboot/tasks/main.yaml

13 lines
468 B
YAML

---
- name: Check if kernel or microcode update requires reboot
ansible.builtin.script: check_reboot.zsh # Your script placed in files/
register: reboot_check
# Prevent Ansible from failing if the script returns false (exit code 1)
failed_when: false
# Trigger the handler ONLY if the script returns true (exit code 0)
changed_when: reboot_check.rc == 0
# Forces this specific task to run during a dry run
check_mode: false
notify: Reboot system