rhel-system-roles-sap/community.sap_install-compa...

107 lines
6.1 KiB
Diff

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