Fix the localectl syntax.

This commit is contained in:
Andrea Dell'Amico 2020-05-22 19:26:37 +02:00
parent 83a90da9d2
commit 6ba39c223e
2 changed files with 10 additions and 3 deletions

View File

@ -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'

View File

@ -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' ]