--- - hosts: windowshosts tasks: - name: Install all updates and reboot as many times as needed ansible.windows.win_updates: category_names: '*' reboot: yes # Optionally, you can increase the reboot_timeout to survive long updates during reboot - name: Ensure we wait long enough for the updates to be applied during reboot ansible.windows.win_updates: reboot: yes reboot_timeout: 600