2025-12-04 09:04:42 -05:00

24 lines
582 B
YAML

---
- name: Reboot target host
hosts: all
become: true
vars:
category: maintenance
subcategory: system
tasks:
- name: Detect distribution
ansible.builtin.setup:
gather_subset:
- os_family
- name: Reboot the machine (Linux)
ansible.builtin.reboot:
reboot_timeout: 600
when: ansible_facts['os_family'] != 'FreeBSD'
- name: Reboot the machine (FreeBSD)
ansible.builtin.reboot:
reboot_timeout: 600
boot_time_command: sysctl kern.boottime
when: ansible_facts['os_family'] == 'FreeBSD'