Debian: really generate locales

/usr/sbin/locale-gen differs between Debian and Ubuntu. With Debian,
locales must be added to /etc/locale.gen before calling locale-gen
command. With Ubuntu, /etc/locale.gen is updated by
/usr/sbin/locale-gen.

Use the locale-gen module which handles both distributions.
This commit is contained in:
Pierre-Louis Bonicoli 2017-04-14 16:07:34 +02:00 committed by Matt Clay
parent bf5d87af07
commit a13d89da68

View file

@ -80,12 +80,13 @@
group: "{{ pg_group }}"
mode: "0644"
- name: Generate pt_BR locale (Debian)
command: locale-gen pt_BR
when: ansible_os_family == 'Debian'
- name: Generate es_ES locale (Debian)
command: locale-gen es_ES
- name: Generate locales (Debian)
locale_gen:
name: '{{ item }}'
state: present
with_items:
- pt_BR
- es_ES
when: ansible_os_family == 'Debian'
# Suse: locales are installed by default (glibc-locale package).