---
- hosts: all
  tasks:
  - name: Install all security, critical, and rollup updates
    win_updates:
      category_names:
        - SecurityUpdates
        - CriticalUpdates
        - UpdateRollups

- hosts: all
  tasks:
  - name: Reboot, if needed
    win_reboot:
      when: update_result.reboot_required

