community.windows.win_product_facts (2.2.0) — module

Provides Windows product and license information

Authors: Dag Wieers (@dagwieers)

Install collection

Install with ansible-galaxy collection install community.windows:==2.2.0


Add to requirements.yml

  collections:
    - name: community.windows
      version: 2.2.0

Description

Provides Windows product and license information.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get product id and product key
  community.windows.win_product_facts:
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Display Windows edition
  debug:
    var: ansible_os_license_edition
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Display Windows license status
  debug:
    var: ansible_os_license_status

Outputs

ansible_facts:
  contains:
    ansible_os_license_channel:
      description: The Windows license channel.
      returned: always
      sample: Volume:MAK
      type: str
    ansible_os_license_edition:
      description: The Windows license edition.
      returned: always
      sample: Windows(R) ServerStandard edition
      type: str
    ansible_os_license_status:
      description: The Windows license status.
      returned: always
      sample: Licensed
      type: str
    ansible_os_product_id:
      description: The Windows product ID.
      returned: always
      sample: 00326-10000-00000-AA698
      type: str
    ansible_os_product_key:
      description: The Windows product key.
      returned: always
      sample: T49TD-6VFBW-VV7HY-B2PXY-MY47H
      type: str
  description: Dictionary containing all the detailed information about the Windows
    product and license.
  returned: always
  type: complex