Add locale configuration tasks to base role

This commit is contained in:
Kris Lamoureux 2023-10-18 16:32:09 -04:00
parent a65c4b9cf6
commit 31e0538b84
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925
2 changed files with 22 additions and 0 deletions

View File

@ -2,6 +2,7 @@ allow_reboot: true
manage_firewall: true manage_firewall: true
manage_network: false manage_network: false
network_type: static network_type: static
locale_default: en_US.UTF-8
packages: packages:
- apache2-utils - apache2-utils

View File

@ -9,6 +9,27 @@
name: gpg name: gpg
state: present state: present
- name: Install locales
ansible.builtin.apt:
name: locales
state: present
- name: Generate locale
community.general.locale_gen:
name: "{{ locale_default }}"
state: present
register: locale_gen_output
- name: Set the default locale
ansible.builtin.lineinfile:
path: /etc/default/locale
regexp: "^LANG="
line: "LANG={{ locale_default }}"
- name: Reconfigure locales
ansible.builtin.command: dpkg-reconfigure -f noninteractive locales
when: locale_gen_output.changed
- name: Manage root authorized_keys - name: Manage root authorized_keys
ansible.builtin.template: ansible.builtin.template:
src: authorized_keys.j2 src: authorized_keys.j2