-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
locale: add role for managing locale
- Loading branch information
Showing
4 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
locale_lang: en_US.UTF-8 | ||
locale_gen: | ||
- en_US.UTF-8 UTF-8 | ||
- pl_PL.UTF-8 UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
- name: Generate locale | ||
changed_when: true | ||
ansible.builtin.command: | ||
cmd: locale-gen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
# community.general.locale_gen gave me mixed results for some reason | ||
# Sticking with the manual generation for now | ||
- name: Ensure locale is enabled | ||
ansible.builtin.lineinfile: | ||
dest: /etc/locale.gen | ||
state: "present" | ||
regexp: "^{{ item }}" | ||
insertafter: "^#{{ item }}" | ||
line: "{{ item }}" | ||
loop: "{{ locale_gen }}" | ||
notify: | ||
- Generate locale | ||
|
||
- name: Set locale | ||
ansible.builtin.copy: | ||
content: "LANG={{ locale_lang }}" | ||
dest: /etc/locale.conf | ||
mode: 0644 |