Resolves: RHEL-74075, new collcection redhat.sap_install and redhat.sap_infrastructure

This commit is contained in:
Than Ngo 2025-01-20 18:47:13 +01:00
parent 704e8b4122
commit cd6d48104d
3 changed files with 26 additions and 40 deletions

2
.gitignore vendored
View File

@ -33,3 +33,5 @@
/redhat.sap_install-1.3.4.tar.gz
/redhat.sap_install-1.3.5.tar.gz
/redhat.sap_install-1.3.7.tar.gz
/redhat.sap_install-1.5.1.tar.gz
/redhat.sap_infrastructure-1.1.1.tar.gz

View File

@ -4,14 +4,6 @@
# disable collection by default since version 3.6.0 (1.3.5)
%bcond_with collection
%if 0%{?fedora} || 0%{?rhel} > 8
%bcond_without html
%else
# pandoc is not supported in rhel 7 and older,
# which is needed for converting .md to .html.
%bcond_with html
%endif
%global collection_name sap_install
%if 0%{?rhel}
%define package_name rhel-system-roles-sap
@ -24,11 +16,13 @@
# 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.3.7
%define collection_sap_install_version 1.5.1
%define collection_sap_infrastructure_version 1.1.1
%global collection_dir collections/ansible_collections/redhat/sap_install
%global mainid e2a233f5a0cb68363798bf014b16552cca681bd0
%global commit_id_sap_install %{collection_version}
%global commit_id_sap_install %{collection_sap_install_version}
%global commit_id_sap_infrastructure %{collection_sap_infrastructure_version}
%global rolename1 sap_general_preconfigure
%global rolename2 sap_ha_install_hana_hsr
%global rolename3 sap_hana_install
@ -38,19 +32,22 @@
%global rolename7 sap_netweaver_preconfigure
%global rolename8 sap_swpm
%global rolename9 sap_vm_preconfigure
%global rolename10 sap_maintain_etc_hosts
%global src_owner linux-system-roles
%global github_repo_sap_install redhat.sap_install
%global rolename_rhel %{rolename1} %{rolename2} %{rolename3} %{rolename4} %{rolename5} %{rolename6} %{rolename7} %{rolename8} %{rolename9}
%global github_repo_sap_infrastructure redhat.sap_infrastructure
%global rolename_rhel %{rolename1} %{rolename2} %{rolename3} %{rolename4} %{rolename5} %{rolename6} %{rolename7} %{rolename8} %{rolename9} %{rolename10}
%global rolenames %{rolename_rhel}
Name: %{package_name}
Summary: System Roles to configure RHEL for running SAP NetWeaver- or SAP HANA-based products
Version: 3.7.0
Version: 3.8.0
Release: 1%{?dist}
License: GPL-3.0-or-later
Url: https://github.com/redhat-sap/community.sap_install
Source0: https://github.com/linux-system-roles/auto-maintenance/archive/%{mainid}/auto-maintenance-%{mainid}.tar.gz
Source1: https://github.com/redhat-sap/redhat.sap_install/archive/%{commit_id_sap_install}/%{github_repo_sap_install}-%{commit_id_sap_install}.tar.gz
Source2: https://github.com/redhat-sap/redhat.sap_infrastructure/archive/%{commit_id_sap_infrastructure}/%{github_repo_sap_infrastructure}-%{commit_id_sap_infrastructure}.tar.gz
# add tests files
Patch1: redhat.sap_install-1.3.4-add_tests.patch
@ -62,17 +59,6 @@ BuildArch: noarch
Requires: rhel-system-roles
%if %{with html}
# Requirements for md2html.sh to build the documentation
%if 0%{?fedora} || 0%{?rhel} >= 9
BuildRequires: rubygem-kramdown-parser-gfm
%else
BuildRequires: pandoc
BuildRequires: asciidoc
BuildRequires: highlight
%endif
%endif
BuildRequires: tar
# Requirements for galaxy_transform.py
@ -105,7 +91,7 @@ Provides: ansible-collection-%{collection_namespace}-%{collection_name} = %{vers
# ansible-galaxy is available by ansible-core on RHEL 8.6 and newer at buildtime.
%define ansible_collection_build() ansible-galaxy collection build
%define ansible_collection_install() ansible-galaxy collection install -n -p %{buildroot}%{_datadir}/ansible/collections %{collection_namespace}-%{collection_name}-%{collection_version}.tar.gz
%define ansible_collection_install() ansible-galaxy collection install -n -p %{buildroot}%{_datadir}/ansible/collections %{collection_namespace}-%{collection_name}-%{collection_sap_install_version}.tar.gz
%if 0%{?fedora} || 0%{?rhel} >= 8
%{!?ansible_collection_files:%define ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/}
@ -124,11 +110,11 @@ to applicable SAP notes so that any SAP software can be installed.
Summary: Collection artifact to import to Automation Hub / Ansible Galaxy
%description collection-artifact
Collection artifact for %{name}. This package contains %{collection_namespace}-%{collection_name}-%{collection_version}.tar.gz
Collection artifact for %{name}. This package contains %{collection_namespace}-%{collection_name}-%{collection_sap_install_version}.tar.gz
%endif
%prep
%setup -q -a1 -n auto-maintenance-%{mainid}
%setup -q -a1 -a2 -n auto-maintenance-%{mainid}
pushd %{github_repo_sap_install}-%{commit_id_sap_install}/
%patch -P1 -p1
@ -137,11 +123,13 @@ pushd %{github_repo_sap_install}-%{commit_id_sap_install}/
# unpack collection tar file
%if %{without collection}
mkdir -p %{collection_dir}
tar zxf redhat-sap_install-%{collection_version}.tar.gz -C %{collection_dir}
tar zxf redhat-sap_install-%{collection_sap_install_version}.tar.gz -C %{collection_dir}
%endif
# workaround for md2html error
sed -i -e "s|for POWER ||g" roles/sap_hana_preconfigure/README.md
# move both roles
for r in sap_vm_preconfigure sap_hypervisor_node_preconfigure ; do
mv ../%{github_repo_sap_infrastructure}-%{commit_id_sap_infrastructure}/roles/$r roles/
done
popd
# remove zero file and symlinks
@ -156,14 +144,6 @@ find -type f \( -iname "*.sh" \) -exec sed -i '1s=^#! */bin/bash=#!/usr/bin/bash
rm -f FILES.json MANIFEST.json
%build
%if %{with html}
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 %{github_repo_sap_install}-%{commit_id_sap_install}/README.md
%endif
%if %{with collection}
# create dest-path
mkdir .collections
@ -228,7 +208,7 @@ cp -pR %{github_repo_sap_install}-%{commit_id_sap_install}/collections $RPM_BUIL
%if %{with collection_artifact}
# Copy collection artifact to /usr/share/ansible/collections/ for collection-artifact
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
mv %{collection_namespace}-%{collection_name}-%{collection_version}.tar.gz $RPM_BUILD_ROOT%{_datadir}/ansible/collections/
mv %{collection_namespace}-%{collection_name}-%{collection_sap_install_version}.tar.gz $RPM_BUILD_ROOT%{_datadir}/ansible/collections/
popd
%endif
@ -249,10 +229,13 @@ popd
%endif
%if %{with collection_artifact}
%files collection-artifact
%{_datadir}/ansible/collections/%{collection_namespace}-%{collection_name}-%{collection_version}.tar.gz
%{_datadir}/ansible/collections/%{collection_namespace}-%{collection_name}-%{collection_sap_install_version}.tar.gz
%endif
%changelog
* Mon Jan 20 2025 Than Ngo <than@redhat.com> - 3.8.0-1
- Resolves: RHEL-74075, new collcection redhat.sap_install and redhat.sap_infrastructure
* Tue May 14 2024 Than Ngo <than@redhat.com> - 3.7.0-1
- Resolves: RHEL-34806, rebase sap roles to version 1.3.7

View File

@ -1,2 +1,3 @@
SHA512 (auto-maintenance-e2a233f5a0cb68363798bf014b16552cca681bd0.tar.gz) = 3d5c784e668605eb8b7862227b456da05ff5dedf84411131a27118b501b6a9bbe8894c4f29e6de4230fe534ef6b2de4653c56a904857d9eb11b452d31aed143c
SHA512 (redhat.sap_install-1.3.7.tar.gz) = 5897825f962f4ce8575867c465ce081fc4f6a87e764172f9059722cabaf71452405492a31373f04673a7724878bc750139069bdbaf45a590822947034bc23aa4
SHA512 (redhat.sap_infrastructure-1.1.1.tar.gz) = 88ad3be52aec71b5fddf900071911e04cbda1b8f225a86c4fea91188b259d6bded1b3423a8b4278123dd1bcf5efad47be937266534332c81abe50f2f6bb18964
SHA512 (redhat.sap_install-1.5.1.tar.gz) = e0a3681463b21d214f420305e080877e099aff108202f2a6b34c281e69c3a1bac86ed74da7587bfa96c36fdd5c20b52887b2b7d264d85f812abbc1e60e6c150d