diff --git a/ansible/roles/win_initial/tasks/initial.yml b/ansible/roles/win_initial/tasks/initial.yml index 2574198..1e066d5 100644 --- a/ansible/roles/win_initial/tasks/initial.yml +++ b/ansible/roles/win_initial/tasks/initial.yml @@ -80,6 +80,21 @@ timezone: GMT Standard Time tags: timezone +- 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: 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} + - name: Administrator Password tags: - password