Change the LC_MESSAGES setting on EL.

This commit is contained in:
Andrea Dell'Amico 2020-07-30 18:30:45 +02:00
parent 099426c4c4
commit dff7c03996
2 changed files with 17 additions and 8 deletions

View File

@ -2,7 +2,8 @@
# timezone
timezone: 'Europe/Rome'
default_locale_lang: "en_US.UTF-8"
default_locale_messages: "C.UTF-8"
default_deb_locale_messages: "C.UTF-8"
default_el_locale_messages: "en_US.UTF-8"
locales_list:
- { name: '{{ default_locale_lang }}' }
- { name: 'en_US.UTF-8' }

View File

@ -5,14 +5,11 @@
locale_gen: name={{ item.name }} state={{ item.state | default('present') }}
with_items: '{{ locales_list }}'
when: ansible_distribution_file_variety == "Debian"
tags: [ 'systemsetup', 'locale' ]
- block:
- name: Set the default locale on Trusty
shell: update-locale LANG={{ default_locale_lang }}
when: ansible_distribution_release == "trusty"
when: ansible_distribution_file_variety == "Debian"
tags: [ 'systemsetup', 'locale' ]
- name: Set the locale on distributions that run systemd
@ -25,7 +22,18 @@
command: localectl set-locale "{{ item }}"
with_items:
- 'LANG={{ default_locale_lang }}'
- 'LC_MESSAGES={{ default_locale_messages }}'
when: localectl_executable.stat.exists | bool
- 'LC_MESSAGES={{ default_deb_locale_messages }}'
when:
- localectl_executable.stat.exists | bool
- ansible_distribution_file_variety == "Debian"
- name: Set the default locale
command: localectl set-locale "{{ item }}"
with_items:
- 'LANG={{ default_locale_lang }}'
- 'LC_MESSAGES={{ default_el_locale_messages }}'
when:
- localectl_executable.stat.exists | bool
- ansible_distribution_file_variety == "RedHat"
tags: [ 'systemsetup', 'locale' ]