From 1128c5f3957d694eaa4401ab9d7d2d1a3ae72545 Mon Sep 17 00:00:00 2001 From: waal70 Date: Sat, 30 Aug 2025 18:28:06 +0200 Subject: [PATCH] Fix locale errors and update motd to remove command that caused the 'TERM not set' error --- tasks/edit-journald.yml | 2 ++ tasks/main.yml | 3 +++ tasks/set-locale.yml | 14 ++++++++++++++ templates/etc/update-motd.d/11-welcome | 2 -- 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 tasks/set-locale.yml diff --git a/tasks/edit-journald.yml b/tasks/edit-journald.yml index 6a9058d..dd5aee4 100644 --- a/tasks/edit-journald.yml +++ b/tasks/edit-journald.yml @@ -10,6 +10,8 @@ - { regexp: "^#?ForwardToSyslog", line: ForwardToSyslog=no } - { regexp: "^#?SystemMaxUse", line: SystemMaxUse=50M } notify: Restart systemd-journald + vars: + ansible_remote_tmp: /tmp # Prevent warnings for auto-created tmp dir # A succesful vacuum does impact log size, but is not considered a change - name: Vacuum journalctl before diff --git a/tasks/main.yml b/tasks/main.yml index fca6626..cc18040 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,5 +1,8 @@ --- # file: common/tasks/main.yml +- name: Ensure there is a default locale set + ansible.builtin.import_tasks: set-locale.yml + - name: Ensure required packages are present on systems ansible.builtin.import_tasks: prereq-packages.yml diff --git a/tasks/set-locale.yml b/tasks/set-locale.yml new file mode 100644 index 0000000..6e26575 --- /dev/null +++ b/tasks/set-locale.yml @@ -0,0 +1,14 @@ +--- +- name: Set default locale to en_US.UTF-8 + ansible.builtin.debconf: + name: locales + question: locales/default_environment_locale + value: en_US.UTF-8 + vtype: select + +- name: Set to generate locales + ansible.builtin.debconf: + name: locales + question: locales/locales_to_be_generated + value: en_US.UTF-8 UTF-8 + vtype: multiselect diff --git a/templates/etc/update-motd.d/11-welcome b/templates/etc/update-motd.d/11-welcome index df6931e..a7649c3 100755 --- a/templates/etc/update-motd.d/11-welcome +++ b/templates/etc/update-motd.d/11-welcome @@ -9,8 +9,6 @@ # Args : none ############################################################### -clear - printf "\nSystem managed by Ansible" printf "\nWelcome to "; lsb_release -ds