Create a separate 'locales' roles (+ en_US)

This commit is contained in:
jeltz 2021-12-13 02:16:13 +01:00
parent ccb1f90c79
commit 7f6c36daaf
11 changed files with 26 additions and 18 deletions

View file

@ -2,9 +2,13 @@
--- ---
# Put a common configuration on all servers # Put a common configuration on all servers
- hosts: all,!unifi - hosts: all,!unifi
vars:
locales_default: en_US.UTF-8
locales_additional:
- fr_FR.UTF-8
roles: roles:
- baseconfig - debian_common
- locales
- basesecurity - basesecurity
- ldap_client
- logrotate - logrotate
- update_motd - update_motd

View file

@ -39,21 +39,6 @@
dest: /etc/apt/sources.list dest: /etc/apt/sources.list
mode: 0644 mode: 0644
# Patriotisme
- name: Ensure French UTF-8 locale exists
locale_gen:
name: fr_FR.UTF-8
state: present
# Fix LC_CTYPE="C"
- name: Select default locale
debconf:
name: locales
question: locales/default_environment_locale
value: fr_FR.UTF-8
vtype: select
notify: Reconfigure locales
# APT-List Changes : send email with changelog # APT-List Changes : send email with changelog
- include_tasks: apt-listchanges.yml - include_tasks: apt-listchanges.yml

View file

@ -0,0 +1,4 @@
---
locales_default: en_US.UTF-8
locales_additional: []
...

View file

@ -1,4 +1,4 @@
--- ---
# Reconfigure locales when conf changes
- name: Reconfigure locales - name: Reconfigure locales
command: dpkg-reconfigure locales -f noninteractive command: dpkg-reconfigure locales -f noninteractive
...

View file

@ -0,0 +1,15 @@
---
- name: Install locales
locale_gen:
name: "{{ item }}"
state: present
loop: "{{ [locales_default] + locales_additional }}"
- name: Select default locale
debconf:
name: locales
question: locales/default_environment_locale
value: "{{ locales_default }}"
vtype: select
notify: Reconfigure locales
...