'Setting Windows language to English (United Kingdom) using Ansible
I am trying to change the Windows Server display language to English (United Kingdom) from Default English (United states)on an Azure vm. I installed the language pack using lpksetup.exe but not sure hw to change display language using ansible . Do we have any ansible windows modules to do that or any other way to achieve it ?
Solution 1:[1]
does this help, you can set the unicode language to English Great Britain, reboot if required
- name: Set the unicode language to English Great Britain, reboot if required community.windows.win_region: unicode_language: en-GB register: result
https://docs.ansible.com/ansible/latest/collections/community/windows/win_region_module.html
Solution 2:[2]
Ansible Code for installing Language Pack for windows servers
- name: Download Language Pack
win_get_url:
url: "{{ repourl }}{{ regionCABFile }}"
dest: "{{ localregionCABFile }}"
- name: Install Language Pack
win_shell: "lpksetup.exe /i '{{ regionlocale }}' /p '{{ localregionCABFile }}' /s /r"
- name: Add Language List
win_shell: |
Set-WinUserLanguageList -LanguageList "{{ regionlocale }}" –Force
- name: Set the GeoID and unicode language to English Great Britain
win_region:
format: "{{ regionlocale }}"
location: "{{ regionlocaleid }}"
unicode_language: "{{ regionunicodelang }}"
register: result
- name: Restart VM
win_reboot:
when: result.restart_required
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | andylondon |
| Solution 2 | Gladiator |
