--- - name: "Maintenance | Reboot systems" hosts: all gather_facts: true tasks: - name: "Windows | Reboot system" when: ansible_facts['os_family'] == 'Windows' ansible.windows.win_reboot: reboot_timeout: 1800 - name: "Linux | Reboot system" when: ansible_facts['os_family'] != 'Windows' ansible.builtin.reboot: reboot_timeout: 1800