diff --git a/handlers/main.yml b/handlers/main.yml index e6364e9..3058174 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -18,3 +18,10 @@ ansible.builtin.systemd_service: name: sshd state: restarted + +- name: Reconfigure locales + ansible.builtin.command: + cmd: "dpkg-reconfigure locales" + environment: + DEBIAN_FRONTEND: noninteractive + changed_when: true diff --git a/tasks/custom-fact.yml b/tasks/custom-fact.yml index 6f04ab3..262a01c 100644 --- a/tasks/custom-fact.yml +++ b/tasks/custom-fact.yml @@ -12,7 +12,9 @@ owner: "{{ ansible_user_id }}" group: "{{ ansible_user_id }}" mode: "0777" + register: cpu_fact -- name: Re-read facts after adding custom fact +- name: Re-read facts if custom fact was installed this run # noqa: no-handler ansible.builtin.setup: filter: ansible_local + when: cpu_fact is changed diff --git a/tasks/set-hostname.yml b/tasks/set-hostname.yml index 4c791b2..dbed882 100644 --- a/tasks/set-hostname.yml +++ b/tasks/set-hostname.yml @@ -17,3 +17,5 @@ regexp: "{{ ansible_host }}.*{{ inventory_hostname }}" line: "{{ ansible_host }} {{ inventory_hostname }}" state: present + vars: + ansible_remote_tmp: /tmp # Prevent warnings for auto-created tmp dir diff --git a/tasks/set-locale.yml b/tasks/set-locale.yml index 6e26575..e0aa1ec 100644 --- a/tasks/set-locale.yml +++ b/tasks/set-locale.yml @@ -5,10 +5,12 @@ question: locales/default_environment_locale value: en_US.UTF-8 vtype: select + notify: Reconfigure locales -- name: Set to generate locales +- name: Generate required locales ansible.builtin.debconf: name: locales question: locales/locales_to_be_generated - value: en_US.UTF-8 UTF-8 + value: en_US.UTF-8 UTF-8, nl_NL.UTF-8 UTF-8, en_GB.UTF-8 UTF-8 vtype: multiselect + notify: Reconfigure locales