library/roles/deb-set-locale: Change the role to use the locale_gen ansible module.

This commit is contained in:
Andrea Dell'Amico 2017-02-23 16:51:56 +01:00
parent bcd806dd94
commit fe62f677a0
2 changed files with 7 additions and 13 deletions

View File

@ -1,8 +1,8 @@
--- ---
deb_default_locale: "en_US.UTF-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_locales_list:
- '{{ deb_default_locale }}' - { name: '{{ deb_default_locale }}' }
- en_US - { name: 'en_US' }
- it_IT.UTF-8 - { name: 'it_IT.UTF-8' }
- it_IT - { name: 'it_IT' }

View File

@ -1,13 +1,7 @@
--- ---
- block: - block:
- name: Define the locales to be generated - name: Add/remove a list of locales
debconf: name=locales question='locales/locales_to_be_generated' value='{{ deb_locales }}' vtype='multiselect' locale_gen: name={{ item.name }} state={{ item.state | default('present') }}
- name: Update the locale default
debconf: name=locales question='locales/default_environment_locale' value='{{ deb_default_locale }}' vtype='select'
- name: Generate the locales
locale_gen: name={{ item }} state=present
with_items: '{{ deb_locales_list }}' with_items: '{{ deb_locales_list }}'
- name: Set the default locale - name: Set the default locale