Related: #2155870, compat-sap-c++-10 is not available for RHEL 8.2 and earlier on hardware platform s390x

This commit is contained in:
Than Ngo 2023-01-19 20:27:57 +01:00
parent dfe8dfc0ce
commit 1882981581
2 changed files with 113 additions and 1 deletions

View File

@ -0,0 +1,106 @@
commit 73455e2e9b73d1d71ad6b6833bed77de197ac940
Author: Bernd Finger <bfinger@redhat.com>
Date: Tue Jan 17 11:22:01 2023 +0100
sap_netweaver_preconfigure: Solve issue #304
diff --git a/roles/sap_netweaver_preconfigure/tasks/sapnote/3119751.yml b/roles/sap_netweaver_preconfigure/tasks/sapnote/3119751.yml
index b922d1f..6c3d0c1 100644
--- a/roles/sap_netweaver_preconfigure/tasks/sapnote/3119751.yml
+++ b/roles/sap_netweaver_preconfigure/tasks/sapnote/3119751.yml
@@ -5,6 +5,11 @@
msg: "SAP note {{ (__sap_netweaver_preconfigure_sapnotes_versions | selectattr('number', 'match', '^3119751$') | first).number }}
(version {{ (__sap_netweaver_preconfigure_sapnotes_versions | selectattr('number', 'match', '^3119751$') | first).version }}): Linux Requirements for SAP Kernel 754 and for SAP Kernel 788 and higher"
+- name: Determine if the compat-sap-c++-10 file exists
+ ansible.builtin.stat:
+ path: /opt/rh/SAP/lib64/compat-sap-c++-10.so
+ register: __sap_netweaver_preconfigure_register_stat_compat_sap_cpp
+
- name: Create directory "{{ sap_netweaver_preconfigure_rpath }}"
ansible.builtin.file:
path: "{{ sap_netweaver_preconfigure_rpath }}"
@@ -12,9 +17,11 @@
owner: root
group: root
mode: '0755'
+ when: __sap_netweaver_preconfigure_register_stat_compat_sap_cpp.stat.exists
- name: Create a link to libstdc++.so.6
ansible.builtin.file:
src: /opt/rh/SAP/lib64/compat-sap-c++-10.so
dest: "{{ sap_netweaver_preconfigure_rpath }}/libstdc++.so.6"
state: link
+ when: __sap_netweaver_preconfigure_register_stat_compat_sap_cpp.stat.exists
commit a925979210ffbff64343be03e21971540db3f428
Author: Bernd Finger <bfinger@redhat.com>
Date: Tue Jan 17 13:09:56 2023 +0100
sap_netweaver_preconfigure: issue #304 - assert part
diff --git a/roles/sap_netweaver_preconfigure/tasks/sapnote/3119751.yml b/roles/sap_netweaver_preconfigure/tasks/sapnote/3119751.yml
index 6c3d0c1..05fcc46 100644
--- a/roles/sap_netweaver_preconfigure/tasks/sapnote/3119751.yml
+++ b/roles/sap_netweaver_preconfigure/tasks/sapnote/3119751.yml
@@ -5,7 +5,7 @@
msg: "SAP note {{ (__sap_netweaver_preconfigure_sapnotes_versions | selectattr('number', 'match', '^3119751$') | first).number }}
(version {{ (__sap_netweaver_preconfigure_sapnotes_versions | selectattr('number', 'match', '^3119751$') | first).version }}): Linux Requirements for SAP Kernel 754 and for SAP Kernel 788 and higher"
-- name: Determine if the compat-sap-c++-10 file exists
+- name: Get info about the compat-sap-c++-10.so file
ansible.builtin.stat:
path: /opt/rh/SAP/lib64/compat-sap-c++-10.so
register: __sap_netweaver_preconfigure_register_stat_compat_sap_cpp
diff --git a/roles/sap_netweaver_preconfigure/tasks/sapnote/assert-3119751.yml b/roles/sap_netweaver_preconfigure/tasks/sapnote/assert-3119751.yml
index 62ad881..1e1da66 100644
--- a/roles/sap_netweaver_preconfigure/tasks/sapnote/assert-3119751.yml
+++ b/roles/sap_netweaver_preconfigure/tasks/sapnote/assert-3119751.yml
@@ -5,10 +5,21 @@
msg: "SAP note {{ (__sap_netweaver_preconfigure_sapnotes_versions | selectattr('number', 'match', '^3119751$') | first).number }}
(version {{ (__sap_netweaver_preconfigure_sapnotes_versions | selectattr('number', 'match', '^3119751$') | first).version }}): Linux Requirements for SAP Kernel 754 and for SAP Kernel 788 and higher"
+- name: Get info about the compat-sap-c++-10.so file
+ ansible.builtin.stat:
+ path: /opt/rh/SAP/lib64/compat-sap-c++-10.so
+ register: __sap_netweaver_preconfigure_register_stat_compat_sap_cpp
+
+- name: Report if checking for a link from libstdc++.so.6 to compat-sap-c++-10.so is skipped
+ ansible.builtin.debug:
+ msg: "INFO: Not checking for link {{ sap_netweaver_preconfigure_rpath }}/libstdc++.so.6 - file /opt/rh/SAP/lib64/compat-sap-c++-10.so does not exist on this system."
+ when: not __sap_netweaver_preconfigure_register_stat_compat_sap_cpp.stat.exists
+
- name: Get info about file "{{ sap_netweaver_preconfigure_rpath }}/libstdc++.so.6"
ansible.builtin.stat:
path: "{{ sap_netweaver_preconfigure_rpath }}/libstdc++.so.6"
register: __sap_netweaver_preconfigure_register_stat_libstdc_assert
+ when: __sap_netweaver_preconfigure_register_stat_compat_sap_cpp.stat.exists
- name: Assert that file "{{ sap_netweaver_preconfigure_rpath }}/libstdc++.so.6" exists
ansible.builtin.assert:
@@ -16,6 +27,7 @@
fail_msg: "FAIL: File {{ sap_netweaver_preconfigure_rpath }}/libstdc++.so.6 does not exist!"
success_msg: "PASS: File {{ sap_netweaver_preconfigure_rpath }}/libstdc++.so.6 exists."
ignore_errors: "{{ sap_netweaver_preconfigure_assert_ignore_errors | d(false) }}"
+ when: __sap_netweaver_preconfigure_register_stat_compat_sap_cpp.stat.exists
- name: Assert that file "{{ sap_netweaver_preconfigure_rpath }}/libstdc++.so.6" is a link
ansible.builtin.assert:
@@ -23,7 +35,9 @@
fail_msg: "FAIL: File {{ sap_netweaver_preconfigure_rpath }}/libstdc++.so.6 is not a link!"
success_msg: "PASS: File {{ sap_netweaver_preconfigure_rpath }}/libstdc++.so.6 is a link."
ignore_errors: "{{ sap_netweaver_preconfigure_assert_ignore_errors | d(false) }}"
- when: __sap_netweaver_preconfigure_register_stat_libstdc_assert.stat.exists
+ when:
+ - __sap_netweaver_preconfigure_register_stat_compat_sap_cpp.stat.exists
+ - __sap_netweaver_preconfigure_register_stat_libstdc_assert.stat.exists
- name: Assert that file "{{ sap_netweaver_preconfigure_rpath }}/libstdc++.so.6" is a link to /opt/rh/SAP/lib64/compat-sap-c++-10.so
ansible.builtin.assert:
@@ -31,4 +45,6 @@
fail_msg: "FAIL: File {{ sap_netweaver_preconfigure_rpath }}/libstdc++.so.6 is not a link to /opt/rh/SAP/lib64/compat-sap-c++-10.so!"
success_msg: "PASS: File {{ sap_netweaver_preconfigure_rpath }}/libstdc++.so.6 is a link to /opt/rh/SAP/lib64/compat-sap-c++-10.so."
ignore_errors: "{{ sap_netweaver_preconfigure_assert_ignore_errors | d(false) }}"
- when: __sap_netweaver_preconfigure_register_stat_libstdc_assert.stat.exists
+ when:
+ - __sap_netweaver_preconfigure_register_stat_compat_sap_cpp.stat.exists
+ - __sap_netweaver_preconfigure_register_stat_libstdc_assert.stat.exists

View File

@ -54,7 +54,7 @@
Name: %{package_name} Name: %{package_name}
Summary: System Roles to configure RHEL for running SAP NetWeaver- or SAP HANA-based products Summary: System Roles to configure RHEL for running SAP NetWeaver- or SAP HANA-based products
Version: 3.4.0 Version: 3.4.0
Release: 1%{?dist} Release: 2%{?dist}
License: GPLv3+ License: GPLv3+
Url: https://github.com/berndfinger/community.sap_install Url: https://github.com/berndfinger/community.sap_install
Source0: https://github.com/linux-system-roles/auto-maintenance/archive/%{mainid}/auto-maintenance-%{mainid}.tar.gz Source0: https://github.com/linux-system-roles/auto-maintenance/archive/%{mainid}/auto-maintenance-%{mainid}.tar.gz
@ -62,6 +62,7 @@ Source1: https://github.com/berndfinger/%{github_repo_sap_install}/archive/%{com
Source4: https://gitlab.cee.redhat.com/bfinger/build-redhat.sap_install/-/raw/main/README.md Source4: https://gitlab.cee.redhat.com/bfinger/build-redhat.sap_install/-/raw/main/README.md
Source5: https://gitlab.cee.redhat.com/bfinger/build-redhat.sap_install/-/raw/main/galaxy.yml Source5: https://gitlab.cee.redhat.com/bfinger/build-redhat.sap_install/-/raw/main/galaxy.yml
Patch1: community.sap_install-shebang.patch Patch1: community.sap_install-shebang.patch
Patch2: community.sap_install-compat-sap-c++-10.patch
BuildArch: noarch BuildArch: noarch
@ -138,6 +139,7 @@ pushd %{github_repo_sap_install}-%{commit_id_sap_install}/
# workaround for md2html error # workaround for md2html error
sed -i -e "s|for POWER ||g" roles/sap_hana_preconfigure/README.md sed -i -e "s|for POWER ||g" roles/sap_hana_preconfigure/README.md
%patch1 -p1 %patch1 -p1
%patch2 -p1
popd popd
# remove zero file and symlinks # remove zero file and symlinks
@ -234,6 +236,10 @@ popd
%endif %endif
%changelog %changelog
* Thu Jan 19 2023 Than Ngo <than@redhat.com> - 3.4.0-2
- compat-sap-c++-10 is not available for RHEL 8.2 and earlier on hardware platform s390x
Related: #2155870
* Tue Jan 10 2023 Than Ngo <than@redhat.com> - 3.4.0-1 * Tue Jan 10 2023 Than Ngo <than@redhat.com> - 3.4.0-1
- Resolves: #2155870, rebase to 1.2.0 upstream version - Resolves: #2155870, rebase to 1.2.0 upstream version