diff --git a/.gitignore b/.gitignore index af3cfea..18ea411 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,5 @@ /community.sap_install-29b37456211c8bf825547f614652f24cf324860a.tar.gz /community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f.tar.gz /community.sap_install-d6756cbaed7657d6ca3508a97dcc3617e995999f.tar.gz +/prepare-redhat.sap_install-main.tar.bz2 +/community.sap_install-f0deb287aaa0fb7d992b95a04b14e263b6690c23.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 13cb4df..0000000 --- a/README.md +++ /dev/null @@ -1,63 +0,0 @@ -Red Hat Enterprise Linux System Roles for SAP Ansible Collection -===================================== - -Red Hat Enterprise Linux System Roles for SAP is a set of roles for preparing Red Hat Enterprise Linux systems for the initial installation of SAP NetWeaver and SAP HANA, for installing SAP HANA Scale-Up and Scale-Out, and for installing a SAP HANA Two-Node Scale-Up cluster. - -## Dependencies - -If installing from RPM, any dependencies will be installed with the package. -Otherwise, the dependencies are listed in `requirements.txt` and/or `bindep.txt`. - -## Installation - -There are currently two ways to use the Red Hat Enterprise Linux System Roles for SAP Collection in your setup. - -### Installation from Automation Hub - -You can install the collection from Automation Hub by running: -``` -ansible-galaxy collection install redhat.sap_install -``` - -After the installation, the roles are available as `redhat.sap_install.`. - -Please see the [Using Ansible collections documentation](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html) for further details. - -### Installation via RPM - -You can install the collection with the software package management tool `dnf` by running: -``` -dnf install rhel-system-roles-sap -``` - -## Documentation -The official RHEL System Roles for SAP documentation can be found [here](https://access.redhat.com/articles/4488731). - -## Support - -### Supported Ansible Versions - -The supported Ansible versions are aligned with currently maintained Ansible versions that support Collections (Ansible 2.9 and later). You can find the list of maintained Ansible versions [here](https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#release-status). - -### Modules and Plugins - -The modules and other plugins in this collection are private, used only internally to the collection, unless otherwise noted. - -### Fully Supported Roles - - - * sap_general_preconfigure - * sap_hana_preconfigure - * sap_netweaver_preconfigure - - - -### Roles in Technology Preview Support - - - * sap_hana_install - * sap_ha_install_hana_hsr - * sap_ha_prepare_pacemaker - * sap_ha_install_pacemaker - * sap_ha_set_hana - diff --git a/community.sap_install-compat-sap-c++-10.patch b/community.sap_install-compat-sap-c++-10.patch deleted file mode 100644 index b171dbd..0000000 --- a/community.sap_install-compat-sap-c++-10.patch +++ /dev/null @@ -1,106 +0,0 @@ -commit 73455e2e9b73d1d71ad6b6833bed77de197ac940 -Author: Bernd Finger -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 -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 diff --git a/galaxy.yml b/galaxy.yml deleted file mode 100644 index 3e58c4e..0000000 --- a/galaxy.yml +++ /dev/null @@ -1,70 +0,0 @@ -### REQUIRED - -# The namespace of the collection. This can be a company/brand/organization or product namespace under which all -# content lives. May only contain alphanumeric lowercase characters and underscores. Namespaces cannot start with -# underscores or numbers and cannot contain consecutive underscores -namespace: __NAMESPACE__ - -# The name of the collection. Has the same character restrictions as 'namespace' -name: sap_install - -# The version of the collection. Must be compatible with semantic versioning -version: 1.1.1 - -# The path to the Markdown (.md) readme file. This path is relative to the root of the collection -readme: README.md - -# A list of the collection's content authors. Can be just the name or in the format 'Full Name (url) -# @nicks:irc/im.site#channel' -authors: -- Bernd Finger -- Sean Freeman -- Rainer Leber -- Markus Koch -- Markus Moster -- Janine Fuchs - -### OPTIONAL but strongly recommended - -# A short summary description of the collection -description: Collection of Ansible Roles for SAP software installation on Red Hat Enterprise Linux - -# Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only -# accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file' -license: -- Apache-2.0 - -# The path to the license file for the collection. This path is relative to the root of the collection. This key is -# mutually exclusive with 'license' -# license_file: '' - -# A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character -# requirements as 'namespace' and 'name' -tags: -- database -- application -- sap - -# Collections that this collection requires to be installed for it to be usable. The key of the dict is the -# collection label 'namespace.name'. The value is a version range -# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version -# range specifiers can be set and are separated by ',' -dependencies: {} - -# The URL of the originating SCM repository -repository: https://github.com/sap-linuxlab/community.sap_install - -# The URL to any online docs -documentation: https://github.com/sap-linuxlab/sap-linuxlab.github.io/blob/master/README.md - -# The URL to the homepage of the collection/project -homepage: https://sap-linuxlab.github.io - -# The URL to the collection issue tracker -issues: https://github.com/sap-linuxlab/community.sap_install/issues - -# A list of file glob-like patterns used to filter any files or directories that should not be included in the build -# artifact. A pattern is matched from the relative path of the file or directory of the collection directory. This -# uses 'fnmatch' to match the files or directories. Some directories and files like 'galaxy.yml', '*.pyc', '*.retry', -# and '.git' are always filtered -build_ignore: ['tests', 'internal-*'] diff --git a/rhel-system-roles-sap.spec b/rhel-system-roles-sap.spec index 3e26165..b95d3b6 100644 --- a/rhel-system-roles-sap.spec +++ b/rhel-system-roles-sap.spec @@ -26,10 +26,10 @@ # collection_version has to be increased by every rebuild # otherwise, it cannot be uploaded to Automation Hub and Galaxy # due to version conflict -%define collection_version 1.2.0 +%define collection_version 1.2.1 %global mainid e2a233f5a0cb68363798bf014b16552cca681bd0 -%global commit_id_sap_install d6756cbaed7657d6ca3508a97dcc3617e995999f +%global commit_id_sap_install f0deb287aaa0fb7d992b95a04b14e263b6690c23 %global rolename1 sap_general_preconfigure %global rolename2 sap_hana_preconfigure %global rolename3 sap_netweaver_preconfigure @@ -54,15 +54,14 @@ Name: %{package_name} Summary: System Roles to configure RHEL for running SAP NetWeaver- or SAP HANA-based products Version: 3.4.0 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3+ Url: https://github.com/berndfinger/community.sap_install Source0: https://github.com/linux-system-roles/auto-maintenance/archive/%{mainid}/auto-maintenance-%{mainid}.tar.gz Source1: https://github.com/berndfinger/%{github_repo_sap_install}/archive/%{commit_id_sap_install}/%{github_repo_sap_install}-%{commit_id_sap_install}.tar.gz -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 +# files/README.md, files/roles/sap_swpm/README.md from https://gitlab.cee.redhat.com/sap-linuxlab/prepare-redhat.sap_install +Source2: prepare-redhat.sap_install-main.tar.bz2 Patch1: community.sap_install-shebang.patch -Patch2: community.sap_install-compat-sap-c++-10.patch BuildArch: noarch @@ -128,18 +127,33 @@ Collection artifact for %{name}. This package contains %{collection_namespace}-% %endif %prep -%setup -q -a1 -n auto-maintenance-%{mainid} +%setup -q -a1 -a2 -n auto-maintenance-%{mainid} # add correct version and namespace for Automation Hub and Galaxy -cp %{SOURCE5} . +cp %{github_repo_sap_install}-%{commit_id_sap_install}/galaxy.yml . sed -i -e "s|^namespace: .*|namespace: %{collection_namespace}|" galaxy.yml sed -i -e "s|^version: .*|version: %{collection_version}|" galaxy.yml +# update README.md and roles/sap_swpm/README.md +cp prepare-redhat.sap_install-main/README.md %{github_repo_sap_install}-%{commit_id_sap_install}/ +cp prepare-redhat.sap_install-main/files/roles/sap_swpm/README.md %{github_repo_sap_install}-%{commit_id_sap_install}/roles/sap_swpm/README.md + pushd %{github_repo_sap_install}-%{commit_id_sap_install}/ # workaround for md2html error sed -i -e "s|for POWER ||g" roles/sap_hana_preconfigure/README.md %patch1 -p1 -%patch2 -p1 + +# modify collection-requirements.yml, fedora.linux_system_roles -> redhat.rhel_system_roles +for r in %{rolenames} ; do + yml=roles/${r}/meta/collection-requirements.yml + [ -f ${yml} ] && sed -i "s,fedora.linux_system_roles,redhat.rhel_system_roles," ${yml} +done + +# modify defaults/main.yml, fedora.linux_system_roles -> redhat.rhel_system_roles +for r in %{rolenames} ; do + yml=roles/${r}/defaults/main.yml + [ -f ${yml} ] && sed -i "s,system_roles_collection: 'fedora.linux_system_roles',system_roles_collection: 'redhat.rhel_system_roles'," ${yml} +done popd # remove zero file and symlinks @@ -169,7 +183,7 @@ readmes="" for role in %{rolenames}; do readmes="${readmes} %{github_repo_sap_install}-%{commit_id_sap_install}/roles/$role/README.md" done -sh md2html.sh $readmes +sh md2html.sh $readmes %{github_repo_sap_install}-%{commit_id_sap_install}/README.md %endif # create dest-path @@ -180,7 +194,6 @@ LANG=en_US.utf-8 LC_ALL=en_US.utf-8 python3 lsr_role2collection.py --role "$role --src-path %{github_repo_sap_install}-%{commit_id_sap_install}/roles/"$role" \ --src-owner %{src_owner} \ --dest-path .collections \ - --readme %{SOURCE4} \ --namespace %{collection_namespace} \ --collection %{collection_name} \ --new-role "$new_role" @@ -189,10 +202,17 @@ done cp -p galaxy.yml .collections/ansible_collections/%{collection_namespace}/%{collection_name} %install -mkdir -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles +mkdir -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles \ + $RPM_BUILD_ROOT%{_pkgdocdir} # create file selection for documents echo "%dir %{_pkgdocdir}" > files_section.txt +cp %{github_repo_sap_install}-%{commit_id_sap_install}/README.md $RPM_BUILD_ROOT%{_pkgdocdir}/ +%if %{with html} +cp %{github_repo_sap_install}-%{commit_id_sap_install}/README.html $RPM_BUILD_ROOT%{_pkgdocdir}/ +%endif +echo "%{_pkgdocdir}/README.*" >> files_section.txt + for role in %{rolenames} ; do mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/$role cp -pR %{github_repo_sap_install}-%{commit_id_sap_install}/roles/$role $RPM_BUILD_ROOT%{_datadir}/ansible/roles/ @@ -236,6 +256,9 @@ popd %endif %changelog +* Mon Jan 30 2023 Than Ngo - 3.4.0-3 +- Related: #2155870, rebase sap roles to version 1.2.1 + * Thu Jan 19 2023 Than Ngo - 3.4.0-2 - compat-sap-c++-10 is not available for RHEL 8.2 and earlier on hardware platform s390x Related: #2155870 diff --git a/sources b/sources index 903f5a7..b5d13ef 100644 --- a/sources +++ b/sources @@ -1,2 +1,3 @@ SHA512 (auto-maintenance-e2a233f5a0cb68363798bf014b16552cca681bd0.tar.gz) = 3d5c784e668605eb8b7862227b456da05ff5dedf84411131a27118b501b6a9bbe8894c4f29e6de4230fe534ef6b2de4653c56a904857d9eb11b452d31aed143c -SHA512 (community.sap_install-d6756cbaed7657d6ca3508a97dcc3617e995999f.tar.gz) = dfa4595ce6d30c26bc692f80362ae47648d0aff95a6994e573e8f32f6c03aca4035d4316fb03416034ae9b45511c66f60fb4349fd120aa5a435c03e00ddb65b2 +SHA512 (prepare-redhat.sap_install-main.tar.bz2) = c300614cd7f57443399dcfe1b579954fafdbb96284c5e3c457b69260eda68bd1f4686ba1ba21bc22478228921dc5341af6f309e74fbafd8a3263596509ecabe2 +SHA512 (community.sap_install-f0deb287aaa0fb7d992b95a04b14e263b6690c23.tar.gz) = f3ec9fef5c680837e6e5113da16923ea537413a72d7b08cd7d1a8dc84c58c636efdf232315ff0cce2e6b1e16ef89d2fe9af002d60c7129c6562d240147acd286