diff --git a/deb-set-locale/defaults/main.yml b/deb-set-locale/defaults/main.yml index 3593f0a4..59dee297 100644 --- a/deb-set-locale/defaults/main.yml +++ b/deb-set-locale/defaults/main.yml @@ -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 diff --git a/deb-set-locale/tasks/main.yml b/deb-set-locale/tasks/main.yml index 74835816..39ee0c8e 100644 --- a/deb-set-locale/tasks/main.yml +++ b/deb-set-locale/tasks/main.yml @@ -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