Compare commits

...

2 Commits

Author SHA1 Message Date
Oleg Vasilev 427b7ecac8 Improve locale configuration 2022-02-12 13:59:25 +03:00
Oleg Vasilev 1529ac5ef5 Update copyright 2022-02-12 13:57:37 +03:00
6 changed files with 39 additions and 6 deletions

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) <year> <copyright holders>
Copyright (c) 2022 Oleg "Zmey!" Vasiliev
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

20
defaults/main.yml Normal file
View File

@ -0,0 +1,20 @@
---
system_locales:
- "{{ system_locale_lang }}"
system_locale_lang: en_US.UTF-8
system_locale_ctype: "{{ system_locale_lang }}"
system_locale_numeric: "{{ system_locale_lang }}"
system_locale_time: "{{ system_locale_lang }}"
system_locale_collate: "{{ system_locale_lang }}"
system_locale_monetary: "{{ system_locale_lang }}"
system_locale_messages: "{{ system_locale_lang }}"
system_locale_paper: "{{ system_locale_lang }}"
system_locale_name: "{{ system_locale_lang }}"
system_locale_address: "{{ system_locale_lang }}"
system_locale_telephone: "{{ system_locale_lang }}"
system_locale_measurement: "{{ system_locale_lang }}"
system_locale_identification: "{{ system_locale_lang }}"
system_locale_all: ""

View File

@ -1,4 +1,4 @@
---
- name: System | Generate locales
shell: locale-gen
- name: Common | Generate locales
command: locale-gen

View File

@ -7,7 +7,7 @@
mode: 0644
owner: root
group: root
notify: System | Generate locales
notify: Common | Generate locales
- name: Common | Set system locale
template:

View File

@ -1,2 +1,15 @@
# {{ ansible_managed }}
LANG={{ use_system_locale }}
LANG="{{ system_locale_lang }}"
LC_CTYPE="{{ system_locale_ctype }}"
LC_NUMERIC="{{ system_locale_numeric }}"
LC_TIME="{{ system_locale_time }}"
LC_COLLATE="{{ system_locale_collate }}"
LC_MONETARY="{{ system_locale_monetary }}"
LC_MESSAGES="{{ system_locale_messages }}"
LC_PAPER="{{ system_locale_paper }}"
LC_NAME="{{ system_locale_name }}"
LC_ADDRESS="{{ system_locale_address }}"
LC_TELEPHONE="{{ system_locale_telephone }}"
LC_MEASUREMENT="{{ system_locale_measurement }}"
LC_IDENTIFICATION="{{ system_locale_identification }}"
LC_ALL="{{ system_locale_all }}"

View File

@ -1,4 +1,4 @@
# {{ ansible_managed }}
{% for item in system_locales | default([]) %}
{% for item in system_locales %}
{{ item }}
{% endfor %}