diff options
| author | Ahmed Abdelhalim <[email protected]> | 2025-08-11 00:32:07 +0200 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2025-08-11 00:32:07 +0200 |
| commit | ac7bb521873b59feb43303b4b1d46c37d16ad8b0 (patch) | |
| tree | 796a4879c1a925908dd03130dec1320060795b72 /roles/locales/tasks | |
| parent | 93326d8c042101c59b969f57b4b9989e3ab7aaeb (diff) | |
Refactor: move the locales into its own role
Diffstat (limited to 'roles/locales/tasks')
| -rw-r--r-- | roles/locales/tasks/main.yml | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/roles/locales/tasks/main.yml b/roles/locales/tasks/main.yml new file mode 100644 index 00000000..d257877d --- /dev/null +++ b/roles/locales/tasks/main.yml @@ -0,0 +1,40 @@ +--- +- name: "Include OS-specific variables" + ansible.builtin.include_vars: "{{ ansible_os_family | lower }}.yml" + +- name: "Ensure locales package is installed" + become: true + ansible.builtin.package: + name: "{{ locales_pkg }}" + state: "present" + +- name: "Update locale.gen" + become: true + ansible.builtin.lineinfile: + dest: "/etc/locale.gen" + mode: "0644" + regexp: "^#{{ item }}" + line: "{{ item }}" + with_items: "{{ locales }}" + notify: "Run locale-gen" + +- name: "Update locale.conf" + become: true + ansible.builtin.copy: + dest: "/etc/locale.conf" + mode: "0644" + content: | + LANG={{ locales_lang }} + LANGUAGE={{ locales_language }} + LC_CTYPE={{ locales_lc_ctype }} + LC_NUMERIC={{ locales_lc_numeric }} + LC_TIME={{ locales_lc_time }} + LC_COLLATE={{ locales_lc_collate }} + LC_MONETARY={{ locales_lc_monetary }} + LC_MESSAGES={{ locales_lc_messages }} + LC_PAPER={{ locales_lc_paper }} + LC_NAME={{ locales_lc_name }} + LC_ADDRESS={{ locales_lc_address }} + LC_TELEPHONE={{ locales_lc_telephone }} + LC_MEASUREMENT={{ locales_lc_measurement }} + LC_IDENTIFICATION={{ locales_lc_identification }} |
