win_ansible_role_activating/tasks/activate.yml

14 lines
391 B
YAML
Raw Normal View History

2022-12-31 20:10:59 +01:00
---
- name: Check if product key is defined
ansible.builtin.fail:
msg: Plese define windows product key
when: windows_product_key == 'undefined'
- name: Set windows product key
ansible.windows.win_powershell:
script: 'cscript.exe "slmgr.vbs" /ipk {{ windows_product_key }}'
- name: Akivate Windows
ansible.windows.win_powershell:
script: "cscript.exe 'slmgr.vbs' /ato"