Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win_product_facts returning list instead of string #540

Open
Yannik opened this issue Nov 10, 2023 · 0 comments
Open

win_product_facts returning list instead of string #540

Yannik opened this issue Nov 10, 2023 · 0 comments

Comments

@Yannik
Copy link

Yannik commented Nov 10, 2023

SUMMARY

As far as my understanding goes, win_product_facts should provide information about the windows operating system licensing status. This is further supported by the logic to retrieve the product key, which only results in one product key, the one of the windows operating system. Finally, the returned facts description also indicates that ansible_os_license_edition, ansible_os_license_status and ansible_os_license_channel should contain a string regarding the windows operating system licensing state.

However, I have noticed that when microsoft office is installed, win_product_facts actually sets ansible_os_license_edition, ansible_os_license_status and ansible_os_license_channel to an array which contains information about both windows and ms office.

Using the examples from the module page:

TASK [windows-activation : Display Windows edition] ************************************************
ok: [myhost] => 
  ansible_os_license_edition:
  - Windows(R), Professional edition
  - Office 16, Office16StandardVL_KMS_Client edition

TASK [windows-activation : Display Windows license status] *****************************************
ok: [myhost] => 
  ansible_os_license_status:
  - Licensed
  - Licensed

The reason for this is the Get-CimInstance SoftwareLicensingProduct | Where-Object PartialProductKey command, which can return more than one result. It would be sensible to append a Where-Object Name -match Windows filter.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

win_product_facts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant