---
- hosts: primary
  gather_facts: True
  tasks:
  - name: Get product id and product key
    win_product_facts:
  - debug: var=hostvars[inventory_hostname]
  - name: Install package dependencies
    win_chocolatey:
      name:
       - chocolatey-core.extension
       - chocolatey-windowsupdate.extension
      state: present
  - name: Install all security, critical, and rollup updates without a scheduled task
    win_updates:
      category_names:
        - SecurityUpdates
        - CriticalUpdates
        - UpdateRollups
