win_ansible_role_activating/tasks/main.yml

16 lines
462 B
YAML
Raw Normal View History

2022-12-31 20:10:59 +01:00
---
- name: Get product id and product key
community.windows.win_product_facts:
- name: Display Windows edition
2022-12-31 20:40:01 +01:00
ansible.builtin.debug:
2022-12-31 20:10:59 +01:00
var: ansible_os_license_edition
- name: Display Windows license status
2022-12-31 20:40:01 +01:00
ansible.builtin.debug:
2022-12-31 20:10:59 +01:00
var: ansible_os_license_status
2022-12-31 20:40:01 +01:00
- name: Activate windows
2022-12-31 20:10:59 +01:00
ansible.builtin.include_tasks: activate.yml
when: ansible_os_license_edition != "Windows(R), Enterprise edition" or ansible_os_license_status != "Licensed"