- name: system setup | locale | install locales-all (debian)
  tags: locale,system,setup
  package:
    name:
      - locales-all
    state: latest

- name: system setup | locale | add de_DE
  tags: locale,system,setup
  locale_gen:
    name: de_DE.UTF-8
    state: present

- name: system setup | locale | set locale to de_DE
  tags: locale,system,setup
  locale_gen:
    name: de_DE.UTF-8
    state: present
  register: locale

- name: system setup | locale | set de_DE as default locale
  tags: locale,system,setup
  command: localectl set-locale LANG=de_DE.UTF-8
  when: locale.changed

- name: system setup | locale | remove en_GB
  tags: locale,system,setup
  locale_gen:
    name: en_GB.UTF-8
    state: absent
  when: locale.changed

