add debug message for troubleshooting
This commit is contained in:
@@ -15,7 +15,8 @@
|
||||
state: present
|
||||
|
||||
- name: get current locale and language configuration
|
||||
ansible.builtin.command: localectl status
|
||||
ansible.builtin.command:
|
||||
cmd: localectl status
|
||||
register: locale_status
|
||||
changed_when: false
|
||||
|
||||
@@ -24,6 +25,12 @@
|
||||
# locale_lang: "{{ locale_status.stdout | regex_search('LANG=([^\n]+)', '\\1') | first }}"
|
||||
# locale_language: "{{ locale_status.stdout | regex_search('LANGUAGE=([^\n]+)', '\\1') | default([locale_lang], true) | first }}"
|
||||
|
||||
- debug:
|
||||
msg:
|
||||
- "{{ locale_status.stdout | regex_search('LANGUAGE=([^\n]+)', '\\1') }}"
|
||||
- "{{ locale_status.stdout | regex_search('LANGUAGE=([^\n]+)', '\\1') | default([locale_lang], true) }}"
|
||||
- "{{ locale_status.stdout | regex_search('LANGUAGE=([^\n]+)', '\\1') | default([locale_lang], true) | first }}"
|
||||
|
||||
- name: set locale to '{{ system_locale }}'
|
||||
become: true
|
||||
changed_when: locale_lang != system_locale
|
||||
@@ -39,3 +46,9 @@
|
||||
cmd: localectl set-locale LANGUAGE={{ system_language }}
|
||||
vars:
|
||||
locale_language: "{{ locale_status.stdout | regex_search('LANGUAGE=([^\n]+)', '\\1') | default([locale_lang], true) | first }}"
|
||||
|
||||
# root@nfs-test:~# localectl status
|
||||
# System Locale: LANG=de_DE.UTF-8
|
||||
# LANGUAGE=en_US.UTF-8
|
||||
# VC Keymap: (unset)
|
||||
# X11 Layout: (unset)
|
||||
|
||||
Reference in New Issue
Block a user