--- - hosts: all gather_facts: yes become: yes tasks: - name: Install Windows updates ansible.windows.win_updates: category_names: - SecurityUpdates - CriticalUpdates - UpdateRollups - DefinitionUpdates - Updates reboot: true reboot_timeout: 3600 register: win_update when: apply_win_updates == true