Activate windows on VMs

This commit is contained in:
abrown38 committed 2024-05-24 08:46:29 +01:00
1 parent d44af34aaa
commit 07ef86be75
1 file changed
+5 -8
+5 -8
View File
@@ -73,18 +73,15 @@
- name: Activation
tags:
- never
- activate_windows
block:
- name: Fix evaluation edition
ansible.windows.win_shell: DISM /online /Set-Edition:ServerStandard /ProductKey:{{ product_key }} /AcceptEula /Quiet
ignore_errors: true
retries: 2
- name: Set KMS server
ansible.windows.win_shell: cscript C:\Windows\System32\slmgr.vbs /skms activate.is.ed.ac.uk
tags: set_kms
- name: Activate Windows
ansible.windows.win_powershell:
script: |
invoke-command -computername {{ win_project }}-{{ inventory_hostname.split('-')[-1] }} -scriptblock { slmgr //b /upk ; slmgr //b /cpky ; slmgr //b /ipk {{ product_key }} ; slmgr //b /ato}
ansible.windows.win_shell: cscript C:\Windows\System32\slmgr.vbs /ipk {{ product_key }}
tags: set_key
- name: Administrator Password
tags: