--- - 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'