From b28bb8706a0b14328ade6616942881c76149306c Mon Sep 17 00:00:00 2001 From: DependencyBot Date: Sun, 1 Dec 2024 07:23:56 +0000 Subject: [PATCH 1/9] Update requirements-workflow.txt on Sun Dec 1 07:23:56 UTC 2024 --- requirements-workflow.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements-workflow.txt b/requirements-workflow.txt index b3d9256a4..c4faa85e2 100644 --- a/requirements-workflow.txt +++ b/requirements-workflow.txt @@ -1,4 +1,4 @@ -ansible==9.1.0 -ansible-compat==4.1.10 -ansible-core==2.16.2 -ansible-lint==6.22.1 +ansible==11.0.0 +ansible-compat==24.10.0 +ansible-core==2.18.0 +ansible-lint==24.10.0 From 7c8d698a697f9502b917aa6de449bb2aa6fe721a Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Mon, 2 Dec 2024 18:01:29 +0100 Subject: [PATCH 2/9] Implementing SAP Note 2369910 - locale --- .../defaults/main.yml | 3 + .../meta/argument_specs.yml | 8 ++ .../tasks/sapnote/2369910.yml | 88 +++++++++++++++++++ .../tasks/sapnote/assert-2369910.yml | 48 ++++++++++ .../vars/RedHat_7.yml | 1 + .../vars/RedHat_8.0.yml | 1 + .../vars/RedHat_8.1.yml | 1 + .../vars/RedHat_8.2.yml | 1 + .../vars/RedHat_8.yml | 1 + .../vars/RedHat_9.yml | 1 + .../sap_general_preconfigure/vars/SLES_15.yml | 2 +- 11 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 roles/sap_general_preconfigure/tasks/sapnote/2369910.yml create mode 100644 roles/sap_general_preconfigure/tasks/sapnote/assert-2369910.yml diff --git a/roles/sap_general_preconfigure/defaults/main.yml b/roles/sap_general_preconfigure/defaults/main.yml index 5cef8b737..8eca2d9ef 100644 --- a/roles/sap_general_preconfigure/defaults/main.yml +++ b/roles/sap_general_preconfigure/defaults/main.yml @@ -166,4 +166,7 @@ sap_general_preconfigure_domain: "{{ sap_domain | d(ansible_domain) }}" # Configuring Process Resource Limits # Example: See README.md +# in SAP Note 2369910 SAP requires English locale. +# If you want to define the locale set this to e.g. en_US.UTF-8 +sap_general_preconfigure_default_locale: "" # END: Default Variables for sap_general_preconfigure diff --git a/roles/sap_general_preconfigure/meta/argument_specs.yml b/roles/sap_general_preconfigure/meta/argument_specs.yml index aaf3cf4a1..a346667b7 100644 --- a/roles/sap_general_preconfigure/meta/argument_specs.yml +++ b/roles/sap_general_preconfigure/meta/argument_specs.yml @@ -341,3 +341,11 @@ argument_specs: sap_general_preconfigure_db_group_name: 'dba' required: false type: str + + sap_general_preconfigure_default_locale: + description: + - Use this variable to specify the default system locale. + example: + sap_general_preconfigure_db_group_name: 'en_US.UTF-8' + required: false + type: str \ No newline at end of file diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2369910.yml b/roles/sap_general_preconfigure/tasks/sapnote/2369910.yml new file mode 100644 index 000000000..12412a281 --- /dev/null +++ b/roles/sap_general_preconfigure/tasks/sapnote/2369910.yml @@ -0,0 +1,88 @@ +# SPDX-License-Identifier: Apache-2.0 +--- +- name: Configure - Display SAP note number 2369910 and its version + ansible.builtin.debug: + msg: "SAP note {{ (__sap_general_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2369910$') | first).number }} + (version {{ (__sap_general_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2369910$') | first).version }}): Configure RHEL 7" + tags: + - always + +## STEP 3.1 -- System Language +- name: Step 3.1 - Check if English Languge is installed + tags: + - sap_general_preconfigure_2369910 + - sap_general_preconfigure_2369910_03 + block: + - name: Get list of installed locales + ansible.builtin.command: locale -a + changed_when: false + register: __sap_general_preconfigure_locales_installed + + - name: Ensure English langpacks are available on RHEL + when: locale_list.stdout_lines | select('match', '^en_') | list | length == 0 + block: + - name: Install RHEL English language packages + ansible.builtin.dnf: + name: + - langpacks-en + - glibc-langpack-en + state: present + + - name: Re-Read list of installed locales + ansible.builtin.command: locale -a + changed_when: false + register: __sap_general_preconfigure_locales_installed + + - name: Check if English locale is installed + ansible.builtin.assert: + that: + # "'en_US.UTF-8' in __sap_general_preconfigure_locales_installed.stdout" + - locale_list.stdout_lines | select('match', '^en_') | list | length > 0 + fail_msg: "No English locale installed. please install English locale" + success_msg: "English locale is installed" + +- name: Step 3.1 - Check if English Languge is Default locale + when: > + (sap_general_preconfigure_default_locale is undefined) or + (sap_general_preconfigure_default_locale | trim | length == 0) + tags: + - sap_general_preconfigure_2369910 + - sap_general_preconfigure_2369910_03 + block: + - name: Check if current default locale is English + ansible.builtin.command: grep "^LANG=en_" /etc/locale.conf + changed_when: false + register: __sap_general_preconfigure_current_default_locale + + - name: Assert that __sap_general_preconfigure_current_default_locale output is not empty + ansible.builtin.assert: + that: + - __sap_general_preconfigure_current_default_locale.stdout_lines | length > 0 + fail_msg: "No English is not set as default locale. Please set sap_general_preconfigure_default_locale variable to define an englsih default locale" + success_msg: "OK - English default locale is set" + +- name: Step 3.1 - Configure English Languge as Default locale + when: > + (sap_general_preconfigure_default_locale is defined) or + (sap_general_preconfigure_default_locale | trim | length > 0) + tags: + - sap_general_preconfigure_2369910 + - sap_general_preconfigure_2369910_03 + block: + - name: Assert that sap_general_preconfigure_default_locale starts with en + ansible.builtin.assert: + that: + - sap_general_preconfigure_default_locale.startswith('en_') + fail_msg: "No Englsih locale defined in sap_general_preconfigure_default_locale" + success_msg: "OK - English default locale is valid" + + - name: Configure English locale + ansible.builtin.lineinfile: + path: /etc/locale.conf + regexp: ^LANG= + line: "LANG={{ sap_general_preconfigure_default_locale }}" + state: present + create: true + owner: root + group: root + mode: '0644' diff --git a/roles/sap_general_preconfigure/tasks/sapnote/assert-2369910.yml b/roles/sap_general_preconfigure/tasks/sapnote/assert-2369910.yml new file mode 100644 index 000000000..eba7b6aa6 --- /dev/null +++ b/roles/sap_general_preconfigure/tasks/sapnote/assert-2369910.yml @@ -0,0 +1,48 @@ +# SPDX-License-Identifier: Apache-2.0 +--- +- name: Assert - Display SAP note number 2369910 and its version + ansible.builtin.debug: + msg: "SAP note {{ (__sap_general_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2369910$') | first).number }} + (version {{ (__sap_general_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2369910$') | first).version }}): Configure RHEL 7" + tags: + - always + +## STEP 3.1 -- System Language +- name: Step 3.1 - Check if English Languge is installed + tags: + - sap_general_preconfigure_2369910 + - sap_general_preconfigure_2369910_03 + block: + - name: Get list of installed locales + ansible.builtin.command: locale -a + changed_when: false + register: __sap_general_preconfigure_locales_installed + + - name: Ensure English langpacks are available on RHEL + when: locale_list.stdout_lines | select('match', '^en_') | list | length == 0 + + - name: Check if English locale is installed + ansible.builtin.assert: + that: + # "'en_US.UTF-8' in __sap_general_preconfigure_locales_installed.stdout" + - locale_list.stdout_lines | select('match', '^en_') | list | length > 0 + fail_msg: "FAIL: No English locale installed. please install English locale" + success_msg: "PASS: English locale is installed" + +- name: Step 3.1 - Check if English Languge is Default locale + tags: + - sap_general_preconfigure_2369910 + - sap_general_preconfigure_2369910_03 + block: + - name: Check if current default locale is English + ansible.builtin.command: grep "^LANG=en_" /etc/locale.conf + changed_when: false + register: __sap_general_preconfigure_current_default_locale + + - name: Assert that __sap_general_preconfigure_current_default_locale output is not empty + ansible.builtin.assert: + that: + - __sap_general_preconfigure_current_default_locale.stdout_lines | length > 0 + fail_msg: "FAIL: English is not set as default locale" + success_msg: "PASS: English default locale is set" + diff --git a/roles/sap_general_preconfigure/vars/RedHat_7.yml b/roles/sap_general_preconfigure/vars/RedHat_7.yml index 76f8dc464..93054ec9c 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_7.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_7.yml @@ -4,6 +4,7 @@ # vars file for sap_general_preconfigure __sap_general_preconfigure_sapnotes_versions: + - { number: '2369910', version: '18'} - { number: '2002167', version: '36' } - { number: '1771258', version: '6' } - { number: '1391070', version: '41' } diff --git a/roles/sap_general_preconfigure/vars/RedHat_8.0.yml b/roles/sap_general_preconfigure/vars/RedHat_8.0.yml index 0f952dcd1..10dc70fcf 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_8.0.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_8.0.yml @@ -4,6 +4,7 @@ # vars file for sap_general_preconfigure __sap_general_preconfigure_sapnotes_versions: + - { number: '2369910', version: '18'} - { number: '2772999', version: '24' } - { number: '1771258', version: '6' } diff --git a/roles/sap_general_preconfigure/vars/RedHat_8.1.yml b/roles/sap_general_preconfigure/vars/RedHat_8.1.yml index 3ffd289a8..5a68d76f5 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_8.1.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_8.1.yml @@ -4,6 +4,7 @@ # vars file for sap_general_preconfigure __sap_general_preconfigure_sapnotes_versions: + - { number: '2369910', version: '18'} - { number: '2772999', version: '24' } - { number: '1771258', version: '6' } diff --git a/roles/sap_general_preconfigure/vars/RedHat_8.2.yml b/roles/sap_general_preconfigure/vars/RedHat_8.2.yml index e47d88065..ebe492daf 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_8.2.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_8.2.yml @@ -4,6 +4,7 @@ # vars file for sap_general_preconfigure __sap_general_preconfigure_sapnotes_versions: + - { number: '2369910', version: '18'} - { number: '2772999', version: '24' } - { number: '1771258', version: '6' } diff --git a/roles/sap_general_preconfigure/vars/RedHat_8.yml b/roles/sap_general_preconfigure/vars/RedHat_8.yml index aa05e96dd..2f5a1bef5 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_8.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_8.yml @@ -4,6 +4,7 @@ # vars file for sap_general_preconfigure __sap_general_preconfigure_sapnotes_versions: + - { number: '2369910', version: '18'} - { number: '2772999', version: '24' } - { number: '1771258', version: '6' } diff --git a/roles/sap_general_preconfigure/vars/RedHat_9.yml b/roles/sap_general_preconfigure/vars/RedHat_9.yml index 9f22fefe0..1460fe620 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_9.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_9.yml @@ -4,6 +4,7 @@ # vars file for sap_general_preconfigure __sap_general_preconfigure_sapnotes_versions: + - { number: '2369910', version: '18'} - { number: '3108316', version: '2' } - { number: '1771258', version: '6' } diff --git a/roles/sap_general_preconfigure/vars/SLES_15.yml b/roles/sap_general_preconfigure/vars/SLES_15.yml index b6b7f7bf0..da250e4de 100644 --- a/roles/sap_general_preconfigure/vars/SLES_15.yml +++ b/roles/sap_general_preconfigure/vars/SLES_15.yml @@ -1,7 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 --- __sap_general_preconfigure_sapnotes_versions: - - '' + - { number: '2369910', version: '18'} __sap_general_preconfigure_packages: - uuidd From 67b4d248dfdee11cc4063f5fa961f39cc515473b Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Tue, 3 Dec 2024 10:52:51 +0100 Subject: [PATCH 3/9] sap_general_preconfigure: fixes for initial version of locale checking and setting Fixes issue #907. Signed-off-by: Bernd Finger --- .../tasks/sapnote/2369910.yml | 73 +++++-------------- .../tasks/sapnote/assert-2369910.yml | 34 +++------ .../vars/RedHat_7.yml | 14 +++- .../vars/RedHat_8.0.yml | 5 +- .../vars/RedHat_8.1.yml | 11 ++- .../vars/RedHat_8.2.yml | 11 ++- .../vars/RedHat_8.yml | 11 ++- .../vars/RedHat_9.yml | 11 ++- 8 files changed, 87 insertions(+), 83 deletions(-) diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2369910.yml b/roles/sap_general_preconfigure/tasks/sapnote/2369910.yml index 12412a281..c6bcf6219 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2369910.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2369910.yml @@ -3,84 +3,49 @@ - name: Configure - Display SAP note number 2369910 and its version ansible.builtin.debug: msg: "SAP note {{ (__sap_general_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2369910$') | first).number }} - (version {{ (__sap_general_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2369910$') | first).version }}): Configure RHEL 7" + (version {{ (__sap_general_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2369910$') | first).version }}): SAP Software on Linux: General Information" tags: - always -## STEP 3.1 -- System Language -- name: Step 3.1 - Check if English Languge is installed +- name: Check locales + when: sap_general_preconfigure_config_all | d(true) or sap_general_preconfigure_2369910 | d(false) tags: - sap_general_preconfigure_2369910 - - sap_general_preconfigure_2369910_03 + - sap_general_preconfigure_configure_locale block: - name: Get list of installed locales ansible.builtin.command: locale -a changed_when: false register: __sap_general_preconfigure_locales_installed - - name: Ensure English langpacks are available on RHEL - when: locale_list.stdout_lines | select('match', '^en_') | list | length == 0 - block: - - name: Install RHEL English language packages - ansible.builtin.dnf: - name: - - langpacks-en - - glibc-langpack-en - state: present - - - name: Re-Read list of installed locales - ansible.builtin.command: locale -a - changed_when: false - register: __sap_general_preconfigure_locales_installed - - - name: Check if English locale is installed + - name: Assert that an English locale is installed ansible.builtin.assert: - that: - # "'en_US.UTF-8' in __sap_general_preconfigure_locales_installed.stdout" - - locale_list.stdout_lines | select('match', '^en_') | list | length > 0 - fail_msg: "No English locale installed. please install English locale" - success_msg: "English locale is installed" + that: __sap_general_preconfigure_locales_installed.stdout_lines | select('match', '^en_') | list | length > 0 + fail_msg: "FAIL: No English locale is installed. Please install an English locale!" + success_msg: "PASS: An English locale is installed." -- name: Step 3.1 - Check if English Languge is Default locale - when: > - (sap_general_preconfigure_default_locale is undefined) or - (sap_general_preconfigure_default_locale | trim | length == 0) - tags: - - sap_general_preconfigure_2369910 - - sap_general_preconfigure_2369910_03 - block: - - name: Check if current default locale is English - ansible.builtin.command: grep "^LANG=en_" /etc/locale.conf + - name: Get the current default locale + ansible.builtin.command: awk '/^LANG=/&&/en_/{print}' /etc/locale.conf changed_when: false register: __sap_general_preconfigure_current_default_locale - - name: Assert that __sap_general_preconfigure_current_default_locale output is not empty + - name: Assert that an English locale is the default ansible.builtin.assert: - that: - - __sap_general_preconfigure_current_default_locale.stdout_lines | length > 0 - fail_msg: "No English is not set as default locale. Please set sap_general_preconfigure_default_locale variable to define an englsih default locale" - success_msg: "OK - English default locale is set" + that: __sap_general_preconfigure_current_default_locale.stdout_lines | length > 0 + fail_msg: "FAIL: English is not set as the default locale. Please define an English default locale with the 'sap_general_preconfigure_default_locale' variable!" + success_msg: "PASS: An English default locale is set." -- name: Step 3.1 - Configure English Languge as Default locale - when: > - (sap_general_preconfigure_default_locale is defined) or - (sap_general_preconfigure_default_locale | trim | length > 0) - tags: - - sap_general_preconfigure_2369910 - - sap_general_preconfigure_2369910_03 - block: - - name: Assert that sap_general_preconfigure_default_locale starts with en + - name: Assert that the role variable sap_general_preconfigure_default_locale starts with 'en_' ansible.builtin.assert: - that: - - sap_general_preconfigure_default_locale.startswith('en_') - fail_msg: "No Englsih locale defined in sap_general_preconfigure_default_locale" - success_msg: "OK - English default locale is valid" + that: sap_general_preconfigure_default_locale.startswith('en_') + fail_msg: "FAIL: No English locale is defined in variable 'sap_general_preconfigure_default_locale'!" + success_msg: "PASS: The English default locale is valid" - name: Configure English locale ansible.builtin.lineinfile: path: /etc/locale.conf regexp: ^LANG= - line: "LANG={{ sap_general_preconfigure_default_locale }}" + line: "LANG=\"{{ sap_general_preconfigure_default_locale }}\"" state: present create: true owner: root diff --git a/roles/sap_general_preconfigure/tasks/sapnote/assert-2369910.yml b/roles/sap_general_preconfigure/tasks/sapnote/assert-2369910.yml index eba7b6aa6..9f96f40c0 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/assert-2369910.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/assert-2369910.yml @@ -3,7 +3,7 @@ - name: Assert - Display SAP note number 2369910 and its version ansible.builtin.debug: msg: "SAP note {{ (__sap_general_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2369910$') | first).number }} - (version {{ (__sap_general_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2369910$') | first).version }}): Configure RHEL 7" + (version {{ (__sap_general_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2369910$') | first).version }}): SAP Software on Linux: General Information" tags: - always @@ -18,31 +18,19 @@ changed_when: false register: __sap_general_preconfigure_locales_installed - - name: Ensure English langpacks are available on RHEL - when: locale_list.stdout_lines | select('match', '^en_') | list | length == 0 - - - name: Check if English locale is installed + - name: Assert that an English locale is installed ansible.builtin.assert: - that: - # "'en_US.UTF-8' in __sap_general_preconfigure_locales_installed.stdout" - - locale_list.stdout_lines | select('match', '^en_') | list | length > 0 - fail_msg: "FAIL: No English locale installed. please install English locale" - success_msg: "PASS: English locale is installed" + that: __sap_general_preconfigure_locales_installed.stdout_lines | select('match', '^en_') | list | length > 0 + fail_msg: "FAIL: No English locale is installed. Please install an English locale!" + success_msg: "PASS: An English locale is installed." -- name: Step 3.1 - Check if English Languge is Default locale - tags: - - sap_general_preconfigure_2369910 - - sap_general_preconfigure_2369910_03 - block: - - name: Check if current default locale is English - ansible.builtin.command: grep "^LANG=en_" /etc/locale.conf + - name: Get the current default locale + ansible.builtin.command: awk '/^LANG=/&&/en_/{print}' /etc/locale.conf changed_when: false register: __sap_general_preconfigure_current_default_locale - - name: Assert that __sap_general_preconfigure_current_default_locale output is not empty + - name: Assert that an English locale is the default ansible.builtin.assert: - that: - - __sap_general_preconfigure_current_default_locale.stdout_lines | length > 0 - fail_msg: "FAIL: English is not set as default locale" - success_msg: "PASS: English default locale is set" - + that: __sap_general_preconfigure_current_default_locale.stdout_lines | length > 0 + fail_msg: "FAIL: English is not set as the default locale. Please define an English default locale with the 'sap_general_preconfigure_default_locale' variable!" + success_msg: "PASS: An English default locale is set." diff --git a/roles/sap_general_preconfigure/vars/RedHat_7.yml b/roles/sap_general_preconfigure/vars/RedHat_7.yml index 93054ec9c..8d59e235c 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_7.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_7.yml @@ -4,7 +4,7 @@ # vars file for sap_general_preconfigure __sap_general_preconfigure_sapnotes_versions: - - { number: '2369910', version: '18'} + - { number: '2369910', version: '18' } - { number: '2002167', version: '36' } - { number: '1771258', version: '6' } - { number: '1391070', version: '41' } @@ -94,6 +94,9 @@ __sap_general_preconfigure_packages_x86_64: - compat-sap-c++-7 - compat-sap-c++-9 - compat-sap-c++-10 +# English locale packages are required as per SAP note 2369910: + - langpacks-en + - glibc-langpack-en __sap_general_preconfigure_packages_ppc64le: - uuidd @@ -104,17 +107,26 @@ __sap_general_preconfigure_packages_ppc64le: - compat-sap-c++-7 - compat-sap-c++-9 - compat-sap-c++-10 +# English locale packages are required as per SAP note 2369910: + - langpacks-en + - glibc-langpack-en __sap_general_preconfigure_packages_ppc64: - uuidd - tcsh - psmisc - compat-sap-c++-5 +# English locale packages are required as per SAP note 2369910: + - langpacks-en + - glibc-langpack-en __sap_general_preconfigure_packages_s390x: - uuidd - tcsh - psmisc +# English locale packages are required as per SAP note 2369910: + - langpacks-en + - glibc-langpack-en __sap_general_preconfigure_packages: "{{ lookup('vars', '__sap_general_preconfigure_packages_' + ansible_architecture) }}" diff --git a/roles/sap_general_preconfigure/vars/RedHat_8.0.yml b/roles/sap_general_preconfigure/vars/RedHat_8.0.yml index 10dc70fcf..d0f8fe031 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_8.0.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_8.0.yml @@ -4,7 +4,7 @@ # vars file for sap_general_preconfigure __sap_general_preconfigure_sapnotes_versions: - - { number: '2369910', version: '18'} + - { number: '2369910', version: '18' } - { number: '2772999', version: '24' } - { number: '1771258', version: '6' } @@ -48,6 +48,9 @@ __sap_general_preconfigure_packages: - psmisc - nfs-utils - bind-utils +# English locale packages are required as per SAP note 2369910: + - langpacks-en + - glibc-langpack-en __sap_general_preconfigure_required_ppc64le: - ibm-power-managed-rhel8 diff --git a/roles/sap_general_preconfigure/vars/RedHat_8.1.yml b/roles/sap_general_preconfigure/vars/RedHat_8.1.yml index 5a68d76f5..375b7e05f 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_8.1.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_8.1.yml @@ -4,7 +4,7 @@ # vars file for sap_general_preconfigure __sap_general_preconfigure_sapnotes_versions: - - { number: '2369910', version: '18'} + - { number: '2369910', version: '18' } - { number: '2772999', version: '24' } - { number: '1771258', version: '6' } @@ -50,6 +50,9 @@ __sap_general_preconfigure_packages_x86_64: - bind-utils - compat-sap-c++-9 - compat-sap-c++-10 +# English locale packages are required as per SAP note 2369910: + - langpacks-en + - glibc-langpack-en __sap_general_preconfigure_packages_ppc64le: - uuidd @@ -60,6 +63,9 @@ __sap_general_preconfigure_packages_ppc64le: - bind-utils - compat-sap-c++-9 - compat-sap-c++-10 +# English locale packages are required as per SAP note 2369910: + - langpacks-en + - glibc-langpack-en __sap_general_preconfigure_packages_s390x: - uuidd @@ -68,6 +74,9 @@ __sap_general_preconfigure_packages_s390x: - psmisc - nfs-utils - bind-utils +# English locale packages are required as per SAP note 2369910: + - langpacks-en + - glibc-langpack-en __sap_general_preconfigure_packages: "{{ lookup('vars', '__sap_general_preconfigure_packages_' + ansible_architecture) }}" diff --git a/roles/sap_general_preconfigure/vars/RedHat_8.2.yml b/roles/sap_general_preconfigure/vars/RedHat_8.2.yml index ebe492daf..bd26d320e 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_8.2.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_8.2.yml @@ -4,7 +4,7 @@ # vars file for sap_general_preconfigure __sap_general_preconfigure_sapnotes_versions: - - { number: '2369910', version: '18'} + - { number: '2369910', version: '18' } - { number: '2772999', version: '24' } - { number: '1771258', version: '6' } @@ -50,6 +50,9 @@ __sap_general_preconfigure_packages_x86_64: - bind-utils - compat-sap-c++-9 - compat-sap-c++-10 +# English locale packages are required as per SAP note 2369910: + - langpacks-en + - glibc-langpack-en __sap_general_preconfigure_packages_ppc64le: - uuidd @@ -60,6 +63,9 @@ __sap_general_preconfigure_packages_ppc64le: - bind-utils - compat-sap-c++-9 - compat-sap-c++-10 +# English locale packages are required as per SAP note 2369910: + - langpacks-en + - glibc-langpack-en __sap_general_preconfigure_packages_s390x: - uuidd @@ -68,6 +74,9 @@ __sap_general_preconfigure_packages_s390x: - psmisc - nfs-utils - bind-utils +# English locale packages are required as per SAP note 2369910: + - langpacks-en + - glibc-langpack-en __sap_general_preconfigure_packages: "{{ lookup('vars', '__sap_general_preconfigure_packages_' + ansible_architecture) }}" diff --git a/roles/sap_general_preconfigure/vars/RedHat_8.yml b/roles/sap_general_preconfigure/vars/RedHat_8.yml index 2f5a1bef5..12ee9598d 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_8.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_8.yml @@ -4,7 +4,7 @@ # vars file for sap_general_preconfigure __sap_general_preconfigure_sapnotes_versions: - - { number: '2369910', version: '18'} + - { number: '2369910', version: '18' } - { number: '2772999', version: '24' } - { number: '1771258', version: '6' } @@ -60,6 +60,9 @@ __sap_general_preconfigure_packages_x86_64: - compat-sap-c++-9 - compat-sap-c++-10 - compat-sap-c++-11 +# English locale packages are required as per SAP note 2369910: + - langpacks-en + - glibc-langpack-en __sap_general_preconfigure_packages_ppc64le: - uuidd @@ -71,6 +74,9 @@ __sap_general_preconfigure_packages_ppc64le: - compat-sap-c++-9 - compat-sap-c++-10 - compat-sap-c++-11 +# English locale packages are required as per SAP note 2369910: + - langpacks-en + - glibc-langpack-en __sap_general_preconfigure_packages_s390x: - uuidd @@ -80,6 +86,9 @@ __sap_general_preconfigure_packages_s390x: - nfs-utils - bind-utils - compat-sap-c++-10 +# English locale packages are required as per SAP note 2369910: + - langpacks-en + - glibc-langpack-en __sap_general_preconfigure_packages: "{{ lookup('vars', '__sap_general_preconfigure_packages_' + ansible_architecture) }}" diff --git a/roles/sap_general_preconfigure/vars/RedHat_9.yml b/roles/sap_general_preconfigure/vars/RedHat_9.yml index 1460fe620..a25793787 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_9.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_9.yml @@ -4,7 +4,7 @@ # vars file for sap_general_preconfigure __sap_general_preconfigure_sapnotes_versions: - - { number: '2369910', version: '18'} + - { number: '2369910', version: '18' } - { number: '3108316', version: '2' } - { number: '1771258', version: '6' } @@ -66,6 +66,9 @@ __sap_general_preconfigure_packages_x86_64: - tuned # package libxcrypt-compat: needed by sapstartsrv and SAP HANA on RHEL 9: - libxcrypt-compat +# English locale packages are required as per SAP note 2369910: + - langpacks-en + - glibc-langpack-en __sap_general_preconfigure_packages_ppc64le: - uuidd @@ -80,6 +83,9 @@ __sap_general_preconfigure_packages_ppc64le: - tuned # package libxcrypt-compat: needed by sapstartsrv and SAP HANA on RHEL 9: - libxcrypt-compat +# English locale packages are required as per SAP note 2369910: + - langpacks-en + - glibc-langpack-en __sap_general_preconfigure_packages_s390x: - uuidd @@ -94,6 +100,9 @@ __sap_general_preconfigure_packages_s390x: - tuned # package libxcrypt-compat: needed by sapstartsrv on RHEL 9: - libxcrypt-compat +# English locale packages are required as per SAP note 2369910: + - langpacks-en + - glibc-langpack-en __sap_general_preconfigure_packages: "{{ lookup('vars', '__sap_general_preconfigure_packages_' + ansible_architecture) }}" From 99831376869d178fadfc1f38e8232569030567d2 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Mon, 16 Dec 2024 09:48:02 +0100 Subject: [PATCH 4/9] sap-general-preconfigure: try to fix PR --- roles/sap_general_preconfigure/meta/argument_specs.yml | 2 +- roles/sap_general_preconfigure/vars/SLES_15.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/sap_general_preconfigure/meta/argument_specs.yml b/roles/sap_general_preconfigure/meta/argument_specs.yml index a346667b7..d91df6849 100644 --- a/roles/sap_general_preconfigure/meta/argument_specs.yml +++ b/roles/sap_general_preconfigure/meta/argument_specs.yml @@ -348,4 +348,4 @@ argument_specs: example: sap_general_preconfigure_db_group_name: 'en_US.UTF-8' required: false - type: str \ No newline at end of file + type: str diff --git a/roles/sap_general_preconfigure/vars/SLES_15.yml b/roles/sap_general_preconfigure/vars/SLES_15.yml index da250e4de..dd1fb3685 100644 --- a/roles/sap_general_preconfigure/vars/SLES_15.yml +++ b/roles/sap_general_preconfigure/vars/SLES_15.yml @@ -1,7 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 --- __sap_general_preconfigure_sapnotes_versions: - - { number: '2369910', version: '18'} + - { number: '2369910', version: '18'} __sap_general_preconfigure_packages: - uuidd From 7ffeded8264933e8bd8757c2881db5bafc868df5 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Mon, 16 Dec 2024 10:57:18 +0100 Subject: [PATCH 5/9] Lint fixes for PR --- roles/sap_general_preconfigure/defaults/main.yml | 2 +- roles/sap_general_preconfigure/tasks/sapnote/assert-2369910.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/sap_general_preconfigure/defaults/main.yml b/roles/sap_general_preconfigure/defaults/main.yml index 8eca2d9ef..7b40cc9b8 100644 --- a/roles/sap_general_preconfigure/defaults/main.yml +++ b/roles/sap_general_preconfigure/defaults/main.yml @@ -166,7 +166,7 @@ sap_general_preconfigure_domain: "{{ sap_domain | d(ansible_domain) }}" # Configuring Process Resource Limits # Example: See README.md -# in SAP Note 2369910 SAP requires English locale. +# in SAP Note 2369910 SAP requires English locale # If you want to define the locale set this to e.g. en_US.UTF-8 sap_general_preconfigure_default_locale: "" # END: Default Variables for sap_general_preconfigure diff --git a/roles/sap_general_preconfigure/tasks/sapnote/assert-2369910.yml b/roles/sap_general_preconfigure/tasks/sapnote/assert-2369910.yml index 9f96f40c0..d4088c99f 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/assert-2369910.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/assert-2369910.yml @@ -8,7 +8,7 @@ - always ## STEP 3.1 -- System Language -- name: Step 3.1 - Check if English Languge is installed +- name: Step 3.1 - Check if English Language is installed tags: - sap_general_preconfigure_2369910 - sap_general_preconfigure_2369910_03 From 3ac2d7eea0c55d55c2194dd2b530c59c386556ac Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Fri, 20 Dec 2024 11:37:39 +0100 Subject: [PATCH 6/9] made requested changes for C.UTF-8 locale --- .../tasks/sapnote/2369910.yml | 14 +++++++------- .../tasks/sapnote/assert-2369910.yml | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2369910.yml b/roles/sap_general_preconfigure/tasks/sapnote/2369910.yml index c6bcf6219..a2405b3b1 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2369910.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2369910.yml @@ -25,7 +25,7 @@ success_msg: "PASS: An English locale is installed." - name: Get the current default locale - ansible.builtin.command: awk '/^LANG=/&&/en_/{print}' /etc/locale.conf + ansible.builtin.command: awk '/^LANG=/&&(/C.UTF-8/||/en_/){print}' /etc/locale.conf changed_when: false register: __sap_general_preconfigure_current_default_locale @@ -35,13 +35,13 @@ fail_msg: "FAIL: English is not set as the default locale. Please define an English default locale with the 'sap_general_preconfigure_default_locale' variable!" success_msg: "PASS: An English default locale is set." - - name: Assert that the role variable sap_general_preconfigure_default_locale starts with 'en_' - ansible.builtin.assert: - that: sap_general_preconfigure_default_locale.startswith('en_') - fail_msg: "FAIL: No English locale is defined in variable 'sap_general_preconfigure_default_locale'!" - success_msg: "PASS: The English default locale is valid" - + # Optimization: Check if defined locale is installed, valid and English. + # This code currently allows an invalid locale such as 'en_XY.UTF-74' - name: Configure English locale + when: + - sap_general_preconfigure_default_locale is defined + - sap_general_preconfigure_default_locale | length > 0 + - sap_general_preconfigure_default_locale.startswith('en_') or sap_general_preconfigure_default_locale.startswith('C.UTF-8') ansible.builtin.lineinfile: path: /etc/locale.conf regexp: ^LANG= diff --git a/roles/sap_general_preconfigure/tasks/sapnote/assert-2369910.yml b/roles/sap_general_preconfigure/tasks/sapnote/assert-2369910.yml index d4088c99f..c653619b5 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/assert-2369910.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/assert-2369910.yml @@ -25,12 +25,12 @@ success_msg: "PASS: An English locale is installed." - name: Get the current default locale - ansible.builtin.command: awk '/^LANG=/&&/en_/{print}' /etc/locale.conf + ansible.builtin.command: awk '/^LANG=/&&(/C.UTF-8/||/en_/){print}' /etc/locale.conf changed_when: false register: __sap_general_preconfigure_current_default_locale - name: Assert that an English locale is the default ansible.builtin.assert: that: __sap_general_preconfigure_current_default_locale.stdout_lines | length > 0 - fail_msg: "FAIL: English is not set as the default locale. Please define an English default locale with the 'sap_general_preconfigure_default_locale' variable!" + fail_msg: "FAIL: English is not set as the default locale. Please define a valid English default locale with the variable 'sap_general_preconfigure_default_locale' !" success_msg: "PASS: An English default locale is set." From de5988fbf7812d55fa576b5758aa840b80e7691b Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Fri, 20 Dec 2024 15:34:06 +0100 Subject: [PATCH 7/9] typo in arguments.specs gefixt --- roles/sap_general_preconfigure/meta/argument_specs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_general_preconfigure/meta/argument_specs.yml b/roles/sap_general_preconfigure/meta/argument_specs.yml index d91df6849..1a35f7eee 100644 --- a/roles/sap_general_preconfigure/meta/argument_specs.yml +++ b/roles/sap_general_preconfigure/meta/argument_specs.yml @@ -346,6 +346,6 @@ argument_specs: description: - Use this variable to specify the default system locale. example: - sap_general_preconfigure_db_group_name: 'en_US.UTF-8' + sap_general_preconfigure_default_locale: 'en_US.UTF-8' required: false type: str From 6715920348c4a1c1c4b3ea92980471dc0cb9164e Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Fri, 20 Dec 2024 15:52:25 +0100 Subject: [PATCH 8/9] default locale was not set when non-english locale was default --- .../tasks/sapnote/2369910.yml | 25 +++++++++---------- roles/sap_general_preconfigure/vars/Suse.yml | 2 +- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2369910.yml b/roles/sap_general_preconfigure/tasks/sapnote/2369910.yml index a2405b3b1..981386bca 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2369910.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2369910.yml @@ -24,23 +24,11 @@ fail_msg: "FAIL: No English locale is installed. Please install an English locale!" success_msg: "PASS: An English locale is installed." - - name: Get the current default locale - ansible.builtin.command: awk '/^LANG=/&&(/C.UTF-8/||/en_/){print}' /etc/locale.conf - changed_when: false - register: __sap_general_preconfigure_current_default_locale - - - name: Assert that an English locale is the default - ansible.builtin.assert: - that: __sap_general_preconfigure_current_default_locale.stdout_lines | length > 0 - fail_msg: "FAIL: English is not set as the default locale. Please define an English default locale with the 'sap_general_preconfigure_default_locale' variable!" - success_msg: "PASS: An English default locale is set." - - # Optimization: Check if defined locale is installed, valid and English. - # This code currently allows an invalid locale such as 'en_XY.UTF-74' - name: Configure English locale when: - sap_general_preconfigure_default_locale is defined - sap_general_preconfigure_default_locale | length > 0 + - __sap_general_preconfigure_locales_installed.stdout_lines | select('match', sap_general_preconfigure_default_locale) | list | length > 0 - sap_general_preconfigure_default_locale.startswith('en_') or sap_general_preconfigure_default_locale.startswith('C.UTF-8') ansible.builtin.lineinfile: path: /etc/locale.conf @@ -51,3 +39,14 @@ owner: root group: root mode: '0644' + + - name: Get the current default locale + ansible.builtin.command: awk '/^LANG=/&&(/C.UTF-8/||/en_/){print}' /etc/locale.conf + changed_when: false + register: __sap_general_preconfigure_current_default_locale + + - name: Assert that an English locale is the default + ansible.builtin.assert: + that: __sap_general_preconfigure_current_default_locale.stdout_lines | length > 0 + fail_msg: "FAIL: English is not set as the default locale. Please define an English default locale with the 'sap_general_preconfigure_default_locale' variable!" + success_msg: "PASS: An English default locale is set." diff --git a/roles/sap_general_preconfigure/vars/Suse.yml b/roles/sap_general_preconfigure/vars/Suse.yml index 7673eb20d..0103ed647 100644 --- a/roles/sap_general_preconfigure/vars/Suse.yml +++ b/roles/sap_general_preconfigure/vars/Suse.yml @@ -7,7 +7,7 @@ # - SUSE Linux Enterprise Server 16 __sap_general_preconfigure_sapnotes_versions: - - { number: '2369910', version: '18'} + - '' # { number: '2369910', version: '18'} __sap_general_preconfigure_packages: - uuidd From c0d9e33477e0339fbb78faa1419c8e019b932f07 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Fri, 20 Dec 2024 16:35:31 +0100 Subject: [PATCH 9/9] change because locale -a always creates *.utf8 --- roles/sap_general_preconfigure/tasks/sapnote/2369910.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2369910.yml b/roles/sap_general_preconfigure/tasks/sapnote/2369910.yml index 981386bca..8e17e19e6 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2369910.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2369910.yml @@ -28,7 +28,7 @@ when: - sap_general_preconfigure_default_locale is defined - sap_general_preconfigure_default_locale | length > 0 - - __sap_general_preconfigure_locales_installed.stdout_lines | select('match', sap_general_preconfigure_default_locale) | list | length > 0 + - __sap_general_preconfigure_locales_installed.stdout_lines | select('match', sap_general_preconfigure_default_locale | regex_replace('UTF-8', 'utf8')) | list | length > 0 - sap_general_preconfigure_default_locale.startswith('en_') or sap_general_preconfigure_default_locale.startswith('C.UTF-8') ansible.builtin.lineinfile: path: /etc/locale.conf