library/roles/deb-set-locale: Force the writing of /etc/default/locale

This commit is contained in:
Andrea Dell'Amico 2016-09-30 19:24:21 +02:00
parent bedaa43a30
commit e0a2c7bddf
2 changed files with 17 additions and 8 deletions

View File

@ -1,3 +1,8 @@
---
deb_default_locale: "en_US.UTF-8"
deb_locales: "{{ deb_default_locale }} en_US, it_IT.UTF-8 it_IT"
deb_locales_list:
- '{{ deb_default_locale }}'
- en_US
- it_IT.UTF-8
- it_IT

View File

@ -1,12 +1,16 @@
---
- name: Generate locales
debconf: name=locales question='locales/locales_to_be_generated' value='{{ deb_locales }}' vtype='multiselect'
tags:
- locale
- block:
- name: Define the locales to be generated
debconf: name=locales question='locales/locales_to_be_generated' value='{{ deb_locales }}' vtype='multiselect'
- name: Update the locale default
debconf: name=locales question='locales/default_environment_locale' value='{{ deb_default_locale }}' vtype='select'
- name: Update the locale default
debconf: name=locales question='locales/default_environment_locale' value='{{ deb_default_locale }}' vtype='select'
tags:
- locale
- name: Generate the locales
locale_gen: name={{ item }} state=present
with_items: '{{ deb_locales_list }}'
- name: Set the default locale
shell: update-locale LANG={{ deb_default_locale }}
tags: locale