X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=playbooks%2Fdebian%2Froles%2Finit-system%2Ftasks%2Flocales.yml;h=58b7aa7371020c2f5ae09531e04bf7e706f0c12b;hb=1aba98e48d7de45085bd03b9f2e58b404a732a42;hp=63a3e1b527d18a28232df4c82e734cde02bf2049;hpb=49d5ce7d9ca6227373e2d9ef860e7641b7b926ea;p=ansible.git diff --git a/playbooks/debian/roles/init-system/tasks/locales.yml b/playbooks/debian/roles/init-system/tasks/locales.yml index 63a3e1b..58b7aa7 100644 --- a/playbooks/debian/roles/init-system/tasks/locales.yml +++ b/playbooks/debian/roles/init-system/tasks/locales.yml @@ -3,7 +3,23 @@ register: has_locales - debug: - msg: "Creating and regenerating locales..." - changed_when: true # Force notification - notify: Configure locales + msg: "Locales have already been configured" + when: has_locales.stdout != "0" + +- name: Configure locales + become: true + lineinfile: + path: /etc/locale.gen + regexp: "^{{ item }}" + line: "{{ item }}" + loop: [ + 'en_US ISO-8859-1', + 'ru_RU.KOI8-R KOI8-R', + 'ru_RU.UTF-8 UTF-8', + ] + when: has_locales.stdout == "0" + +- name: Regenerate locales + become: true + command: /usr/sbin/locale-gen when: has_locales.stdout == "0"