From ee86afba89119f2ca9dd448b2d6af369979adc79 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Sachse?= <joerg.sachse@slub-dresden.de>
Date: Mon, 27 Jan 2025 13:33:47 +0100
Subject: [PATCH] fix: Set locale (as suggested in ExLibris Case 07844382

---
 molecule/resources/playbooks/prepare.yml |  4 ++++
 tasks/rosetta/configure_shell.yml        | 23 ++++++++++++++++++++++-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/molecule/resources/playbooks/prepare.yml b/molecule/resources/playbooks/prepare.yml
index f830925..5e89224 100644
--- a/molecule/resources/playbooks/prepare.yml
+++ b/molecule/resources/playbooks/prepare.yml
@@ -107,6 +107,10 @@
       become: true
       when: pki.failed is false
       changed_when: false
+    - name: create .cshrc file
+      ansible.builtin.file:
+        path: "/exlibris/dps/.cshrc"
+        state: touch
 
   roles:
     - { role: "ansible_lza_install_common", become: true }
diff --git a/tasks/rosetta/configure_shell.yml b/tasks/rosetta/configure_shell.yml
index 06ec572..b60a83a 100644
--- a/tasks/rosetta/configure_shell.yml
+++ b/tasks/rosetta/configure_shell.yml
@@ -1,8 +1,29 @@
 ---
-- name: add aliases for Rosetta user
+- name: Add aliases for Rosetta user.
   ansible.builtin.blockinfile:
     path: "/exlibris/dps/.cshrc"
     marker: "# {mark} ANSIBLE MANAGED BLOCK - SLUB extras"
     block: |
       alias dps_multitail    'cd $op_dir/logs/; multitail --mergeall sdvlzarosappprod01/server.log sdvlzarosappprod02/server.log sdvlzarosappprod03/server.log'
   when: "'prod0' in ansible_hostname"
+
+- name: >
+    Remove default locale (as suggested in ExLibris case 07844382)
+    (https://support.proquest.com/500QO00000PNI2fYAH).
+  ansible.builtin.lineinfile:
+    path: "/exlibris/dps/.cshrc"
+    regexp: "{{ item }}"
+    state: absent
+  loop:
+    - "setenv LANG C"
+    - "setenv LC_ALL C"
+
+- name: >
+    Set locale (as suggested in ExLibris case 07844382)
+    (https://support.proquest.com/500QO00000PNI2fYAH).
+  ansible.builtin.blockinfile:
+    path: "/exlibris/dps/.cshrc"
+    marker: "# {mark} ANSIBLE MANAGED BLOCK - SC 07844382"
+    block: |
+      setenv LANG en_US.UTF-8
+      setenv LC_ALL en_US.UTF-8
-- 
GitLab