Following this week coverage of Ansible, Today I will show you how to restart Windows managed machines with Ansible.
Below is the playbook that will restart all the machines that are in Windows inventory. The machines will restart immediately without any delay.
--- - name: "Restart hosts" hosts: windows tasks: - name: "Restart Windows" win_reboot:
Note: If you would like to postpone the reboot you can add the following line and delay the reboot (the value is in seconds).