aboutsummaryrefslogtreecommitdiffstats
path: root/roles/debian/tasks/locale.yml
blob: bea2472e448f7d993254ba730c2044f63af05499 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
- name: Setting locales to be generated
  debconf:
    name: locales
    question: locales/locales_to_be_generated
    value: "{{ locale_generated|join(', ') }}"
    vtype: multiselect
  register: locale_generated_debconf

- name: dpkg-reconfigure locales
  block:
  - template:
      dest: '/etc/locale.gen'
      src: locale.gen.j2
      owner: root
      group: root
      mode: 0644
  - debconf:
      name: locales
      question: locales/locales_to_be_generated
      value: "{{ locale_generated|join(', ') }}"
      vtype: multiselect
  - command: dpkg-reconfigure -fnoninteractive locales
  when: locale_generated_debconf is changed

- name: Setting default locale
  template:
    dest: '/etc/default/locale'
    src: locale.j2
    owner: root
    group: root
    mode: 0644

- name: Update locales debconf
  debconf:
    name: locales
    question: locales/default_environment_locale
    value: '{{ locale_default.LANG }}'
    vtype: select

# vim: set ts=2 sw=2 et: