diff --git a/defaults/main.yml b/defaults/main.yml index 55c1682..13f6710 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,12 +1,16 @@ --- # timezone timezone: 'Europe/Rome' -default_locale: "en_US.UTF-8" +default_locale_lang: "en_US.UTF-8" +default_locale_messages: "C.UTF-8" locales_list: - { name: '{{ default_locale }}' } + - { name: 'en_US.UTF-8' } - { name: 'en_US' } - { name: 'it_IT.UTF-8' } - { name: 'it_IT' } + - { name: 'C.UTF-8' } + - { name: 'C' } enable_env_proxy: False env_proxy_http_host: 'localhost' diff --git a/tasks/locale.yml b/tasks/locale.yml index f1cc1f2..44f0dbf 100644 --- a/tasks/locale.yml +++ b/tasks/locale.yml @@ -10,7 +10,7 @@ - block: - name: Set the default locale on Trusty - shell: update-locale LANG={{ default_locale }} + shell: update-locale LANG={{ default_locale_lang }} when: ansible_distribution_release == "trusty" tags: [ 'systemsetup', 'locale' ] @@ -22,7 +22,10 @@ register: localectl_executable - name: Set the default locale - command: localectl set-locale {{ default_locale }} + command: localectl set-locale "{{ item }}" + with_items: + - 'LANG={{ default_locale_lang }}' + - 'LC_MESSAGES={{ default_locale_messages }}' when: localectl_executable.stat.exists | bool tags: [ 'systemsetup', 'locale' ]