community.windows.win_product_facts 模块 – 提供 Windows 产品和许可证信息

注意

此模块是 community.windows 集合 (版本 2.3.0) 的一部分。

如果您使用的是 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install community.windows

要在剧本中使用它,请指定:community.windows.win_product_facts

概要

  • 提供 Windows 产品和许可证信息。

示例

- name: Get product id and product key
  community.windows.win_product_facts:

- name: Display Windows edition
  debug:
    var: ansible_os_license_edition

- name: Display Windows license status
  debug:
    var: ansible_os_license_status

返回的facts

此模块返回的facts 将添加到/更新 hostvars 主机 facts 中,并且可以像任何其他主机 fact 一样按名称引用。无需注册即可使用它们。

描述

ansible_os_license_channel

字符串

Windows 许可证渠道。

返回:始终

示例:"Volume:MAK"

ansible_os_license_edition

字符串

Windows 许可证版本。

返回:始终

示例:"Windows(R) ServerStandard edition"

ansible_os_license_status

字符串

Windows 许可证状态。

返回:始终

示例:"Licensed"

ansible_os_product_id

字符串

Windows 产品 ID。

返回:始终

示例:"00326-10000-00000-AA698"

ansible_os_product_key

字符串

Windows 产品密钥。

返回:始终

示例:"T49TD-6VFBW-VV7HY-B2PXY-MY47H"

作者

  • Dag Wieers (@dagwieers)