--- - name: Get product id and product key community.windows.win_product_facts: - name: Display Windows edition ansible.builtin.debug: var: ansible_os_license_edition - name: Display Windows license status ansible.builtin.debug: var: ansible_os_license_status - name: Activate windows ansible.builtin.include_tasks: activate.yml when: ansible_os_license_edition != "Windows(R), Enterprise edition" or ansible_os_license_status != "Licensed"