From fe62f677a0d4f172bf6f9e46646057a192f81c24 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 23 Feb 2017 16:51:56 +0100 Subject: [PATCH] library/roles/deb-set-locale: Change the role to use the locale_gen ansible module. --- deb-set-locale/defaults/main.yml | 10 +++++----- deb-set-locale/tasks/main.yml | 10 ++-------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/deb-set-locale/defaults/main.yml b/deb-set-locale/defaults/main.yml index 59dee297..c8e7d739 100644 --- a/deb-set-locale/defaults/main.yml +++ b/deb-set-locale/defaults/main.yml @@ -1,8 +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 + - { name: '{{ deb_default_locale }}' } + - { name: 'en_US' } + - { name: 'it_IT.UTF-8' } + - { name: 'it_IT' } + diff --git a/deb-set-locale/tasks/main.yml b/deb-set-locale/tasks/main.yml index 39ee0c8e..39ae7af6 100644 --- a/deb-set-locale/tasks/main.yml +++ b/deb-set-locale/tasks/main.yml @@ -1,13 +1,7 @@ --- - 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: Generate the locales - locale_gen: name={{ item }} state=present + - name: Add/remove a list of locales + locale_gen: name={{ item.name }} state={{ item.state | default('present') }} with_items: '{{ deb_locales_list }}' - name: Set the default locale