Resolves: RHEL-73378, new collcection redhat.sap_install, redhat.sap_infrastructure

This commit is contained in:
Than Ngo 2025-01-29 11:09:23 +01:00
parent 594c77eae7
commit 743608e304
3 changed files with 67 additions and 68 deletions

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
/auto-maintenance-e2a233f5a0cb68363798bf014b16552cca681bd0.tar.gz /auto-maintenance-e2a233f5a0cb68363798bf014b16552cca681bd0.tar.gz
/redhat.sap_install-1.3.5.tar.gz /redhat.sap_install-1.3.5.tar.gz
/redhat.sap_install-1.3.7.tar.gz /redhat.sap_install-1.3.7.tar.gz
/auto-maintenance-e4e63cd408561b39e11d6285ab81f32a999719db.tar.gz
/redhat.sap_infrastructure-1.1.1.tar.gz
/redhat.sap_install-1.5.2.tar.gz

View File

@ -4,15 +4,9 @@
# disable collection by default since version 3.6.0 (1.3.5) # disable collection by default since version 3.6.0 (1.3.5)
%bcond_with collection %bcond_with collection
%if 0%{?fedora} || 0%{?rhel} > 8 %global collection_name_sap_install sap_install
%bcond_without html %global collection_name_sap_infrastructure sap_infrastructure
%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} %if 0%{?rhel}
%define package_name rhel-system-roles-sap %define package_name rhel-system-roles-sap
%global collection_namespace redhat %global collection_namespace redhat
@ -24,11 +18,14 @@
# collection_version has to be increased by every rebuild # collection_version has to be increased by every rebuild
# otherwise, it cannot be uploaded to Automation Hub and Galaxy # otherwise, it cannot be uploaded to Automation Hub and Galaxy
# due to version conflict # due to version conflict
%define collection_version 1.3.7 %define collection_sap_install_version 1.5.2
%define collection_sap_infrastructure_version 1.1.1
%global collection_dir collections/ansible_collections/redhat/sap_install %global collection_dir_sap_install collections/ansible_collections/%{collection_namespace}/%{collection_name_sap_install}
%global mainid e2a233f5a0cb68363798bf014b16552cca681bd0 %global collection_dir_sap_infrastructure collections/ansible_collections/%{collection_namespace}/%{collection_name_sap_infrastructure}
%global commit_id_sap_install %{collection_version} %global mainid e4e63cd408561b39e11d6285ab81f32a999719db
%global commit_id_sap_install %{collection_sap_install_version}
%global commit_id_sap_infrastructure %{collection_sap_infrastructure_version}
%global rolename1 sap_general_preconfigure %global rolename1 sap_general_preconfigure
%global rolename2 sap_ha_install_hana_hsr %global rolename2 sap_ha_install_hana_hsr
%global rolename3 sap_hana_install %global rolename3 sap_hana_install
@ -38,19 +35,23 @@
%global rolename7 sap_netweaver_preconfigure %global rolename7 sap_netweaver_preconfigure
%global rolename8 sap_swpm %global rolename8 sap_swpm
%global rolename9 sap_vm_preconfigure %global rolename9 sap_vm_preconfigure
%global rolename10 sap_maintain_etc_hosts
%global src_owner linux-system-roles %global src_owner linux-system-roles
%global github_repo_sap_install redhat.sap_install %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_sap_install %{rolename1} %{rolename2} %{rolename3} %{rolename4} %{rolename5} %{rolename7} %{rolename8} %{rolename10}
%global rolename_sap_infrastructure %{rolename6} %{rolename9}
%global rolenames %{rolename_rhel} %global rolenames %{rolename_rhel}
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.7.0 Version: 3.8.2
Release: 1%{?dist} Release: 1%{?dist}
License: GPL-3.0-or-later License: GPL-3.0-or-later
Url: https://github.com/redhat-sap/community.sap_install 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 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 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 # add tests files
Patch1: redhat.sap_install-1.3.4-add_tests.patch Patch1: redhat.sap_install-1.3.4-add_tests.patch
@ -62,16 +63,7 @@ BuildArch: noarch
Requires: rhel-system-roles Requires: rhel-system-roles
%if %{with html} BuildRequires: tar
# 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
# Requirements for galaxy_transform.py # Requirements for galaxy_transform.py
BuildRequires: python3-ruamel-yaml BuildRequires: python3-ruamel-yaml
@ -86,17 +78,16 @@ Requires: python3-netaddr
BuildRequires: ansible-core >= 2.11.0 BuildRequires: ansible-core >= 2.11.0
Requires: (ansible-core >= 2.11.0 or ansible >= 2.9.0) Requires: (ansible-core >= 2.11.0 or ansible >= 2.9.0)
%endif %endif
%endif
%if %{undefined __ansible_provides} %if %{undefined __ansible_provides}
Provides: ansible-collection(%{collection_namespace}.%{collection_name}) = %{version} Provides: ansible-collection(%{collection_namespace}.%{collection_name}) = %{version}
%endif %endif
# be compatible with the usual Fedora Provides: # be compatible with the usual Fedora Provides:
Provides: ansible-collection-%{collection_namespace}-%{collection_name} = %{version}-%{release} Provides: ansible-collection-%{collection_namespace}-%{collection_name} = %{version}-%{release}
%endif
# ansible-galaxy is available by ansible-core on RHEL 8.6 and newer at buildtime. # 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_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 %if 0%{?fedora} || 0%{?rhel} >= 8
%{!?ansible_collection_files:%define ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/} %{!?ansible_collection_files:%define ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/}
@ -115,26 +106,28 @@ to applicable SAP notes so that any SAP software can be installed.
Summary: Collection artifact to import to Automation Hub / Ansible Galaxy Summary: Collection artifact to import to Automation Hub / Ansible Galaxy
%description collection-artifact %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
* %{collection_namespace}-%{collection_name_sap_infrastructure}-%{collection_sap_infrastructure_version}.tar.gz
%endif %endif
%prep %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}/ pushd %{github_repo_sap_install}-%{commit_id_sap_install}/
%patch -P1 -p1 %patch -P1 -p1
%patch -P2 -p1 %patch -P2 -p1
popd
# unpack collection tar file # unpack collection tar file
%if %{without collection} %if %{without collection}
mkdir -p %{collection_dir} mkdir -p %{collection_dir_sap_install} %{collection_dir_sap_infrastructure}
tar zxf redhat-sap_install-%{collection_version}.tar.gz -C %{collection_dir} # sap_install collection
tar zxf %{github_repo_sap_install}-%{commit_id_sap_install}/%{collection_namespace}-%{collection_name_sap_install}-%{collection_sap_install_version}.tar.gz -C %{collection_dir_sap_install}
# sap_infrastructure collection
tar zxf %{github_repo_sap_infrastructure}-%{commit_id_sap_infrastructure}/%{collection_namespace}-%{collection_name_sap_infrastructure}-%{commit_id_sap_infrastructure}.tar.gz -C %{collection_dir_sap_infrastructure}
%endif %endif
# workaround for md2html error
sed -i -e "s|for POWER ||g" roles/sap_hana_preconfigure/README.md
popd
# remove zero file and symlinks # remove zero file and symlinks
find . -type f -size 0 -delete find . -type f -size 0 -delete
find . -type l -delete find . -type l -delete
@ -147,19 +140,11 @@ find -type f \( -iname "*.sh" \) -exec sed -i '1s=^#! */bin/bash=#!/usr/bin/bash
rm -f FILES.json MANIFEST.json rm -f FILES.json MANIFEST.json
%build %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} %if %{with collection}
# create dest-path # create dest-path
mkdir .collections mkdir .collections
for role in %{rolenames} ; do for role in %{rolename_sap_install} ; do
LANG=en_US.utf-8 LC_ALL=en_US.utf-8 python3 lsr_role2collection.py --role "$role" \ 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-path %{github_repo_sap_install}-%{commit_id_sap_install}/roles/"$role" \
--src-owner %{src_owner} \ --src-owner %{src_owner} \
@ -169,7 +154,9 @@ LANG=en_US.utf-8 LC_ALL=en_US.utf-8 python3 lsr_role2collection.py --role "$role
--new-role "$new_role" --new-role "$new_role"
done done
# update galaxy.yml
cp -p galaxy.yml .collections/ansible_collections/%{collection_namespace}/%{collection_name} cp -p galaxy.yml .collections/ansible_collections/%{collection_namespace}/%{collection_name}
# update README.md # update README.md
cp %{github_repo_sap_install}-%{commit_id_sap_install}/README.md .collections/ansible_collections/%{collection_namespace}/%{collection_name} cp %{github_repo_sap_install}-%{commit_id_sap_install}/README.md .collections/ansible_collections/%{collection_namespace}/%{collection_name}
@ -177,7 +164,6 @@ cp %{github_repo_sap_install}-%{commit_id_sap_install}/README.md .collections/an
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/ pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
%ansible_collection_build %ansible_collection_build
popd popd
%endif %endif
%install %install
@ -188,21 +174,25 @@ mkdir -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles \
echo "%dir %{_pkgdocdir}" > files_section.txt echo "%dir %{_pkgdocdir}" > files_section.txt
cp %{github_repo_sap_install}-%{commit_id_sap_install}/README.md $RPM_BUILD_ROOT%{_pkgdocdir}/ 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 echo "%{_pkgdocdir}/README.*" >> files_section.txt
for role in %{rolenames} ; do # install sap_install roles
for role in %{rolename_sap_install} ; do
mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/$role 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/ cp -pR %{github_repo_sap_install}-%{commit_id_sap_install}/roles/$role $RPM_BUILD_ROOT%{_datadir}/ansible/roles/
install -m 644 %{github_repo_sap_install}-%{commit_id_sap_install}/LICENSE \ install -m 644 %{github_repo_sap_install}-%{commit_id_sap_install}/LICENSE \
%{github_repo_sap_install}-%{commit_id_sap_install}/roles/$role/README.md \ %{github_repo_sap_install}-%{commit_id_sap_install}/roles/$role/README.md \
$RPM_BUILD_ROOT%{_pkgdocdir}/$role/ $RPM_BUILD_ROOT%{_pkgdocdir}/$role/
%if %{with html} echo "%dir %{_pkgdocdir}/$role" >> files_section.txt
install -m 644 %{github_repo_sap_install}-%{commit_id_sap_install}/roles/$role/README.html \ done
# install sap_infrastructure roles
for role in %{rolename_sap_infrastructure} ; do
mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/$role
cp -pR %{github_repo_sap_infrastructure}-%{commit_id_sap_infrastructure}/roles/$role $RPM_BUILD_ROOT%{_datadir}/ansible/roles/
install -m 644 %{github_repo_sap_infrastructure}-%{commit_id_sap_infrastructure}/LICENSE \
%{github_repo_sap_infrastructure}-%{commit_id_sap_infrastructure}/roles/$role/README.md \
$RPM_BUILD_ROOT%{_pkgdocdir}/$role/ $RPM_BUILD_ROOT%{_pkgdocdir}/$role/
%endif
echo "%dir %{_pkgdocdir}/$role" >> files_section.txt echo "%dir %{_pkgdocdir}/$role" >> files_section.txt
done done
@ -212,14 +202,19 @@ pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name
%ansible_collection_install %ansible_collection_install
popd popd
%else %else
cp -pR %{github_repo_sap_install}-%{commit_id_sap_install}/collections $RPM_BUILD_ROOT%{_datadir}/ansible/ cp -pR collections $RPM_BUILD_ROOT%{_datadir}/ansible/
%endif %endif
# install collection_artifact # install collection_artifact
%if %{with collection_artifact} %if %{with collection_artifact}
# Copy collection artifact to /usr/share/ansible/collections/ for collection-artifact # Copy collection artifact to /usr/share/ansible/collections/ for collection-artifact
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/ pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name_sap_install}/
mv %{collection_namespace}-%{collection_name}-%{collection_version}.tar.gz $RPM_BUILD_ROOT%{_datadir}/ansible/collections/ mv %{collection_namespace}-%{collection_name_sap_install}-%{collection_sap_install_version}.tar.gz \
$RPM_BUILD_ROOT%{_datadir}/ansible/collections/
popd
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name_sap_infrastructure}/
mv %{collection_namespace}-%{collection_name_sap_infrastructure}-%{collection_sap_infrastructure_version}.tar.gz \
$RPM_BUILD_ROOT%{_datadir}/ansible/collections/
popd popd
%endif %endif
@ -229,10 +224,6 @@ popd
%doc %{_pkgdocdir}/*/README.md %doc %{_pkgdocdir}/*/README.md
%license %{_pkgdocdir}/*/LICENSE %license %{_pkgdocdir}/*/LICENSE
%{_datadir}/ansible/roles/* %{_datadir}/ansible/roles/*
%if %{with html}
%{_pkgdocdir}/*/README.html
%endif
%if %{with collection} %if %{with collection}
%{ansible_collection_files} %{ansible_collection_files}
%else %else
@ -240,10 +231,14 @@ popd
%endif %endif
%if %{with collection_artifact} %if %{with collection_artifact}
%files collection-artifact %files collection-artifact
%{_datadir}/ansible/collections/%{collection_namespace}-%{collection_name}-%{collection_version}.tar.gz %{_datadir}/ansible/collections/%{collection_namespace}-%{collection_name_sap_install}-%{collection_sap_install_version}.tar.gz
%{_datadir}/ansible/collections/%{collection_namespace}-%{collection_name_sap_infrastructure}-%{collection_sap_infrastructure_version}.tar.gz
%endif %endif
%changelog %changelog
* Wed Jan 29 2025 Than Ngo <than@redhat.com> - 3.8.2-1
- Resolves: RHEL-73378, new collcection redhat.sap_install, redhat.sap_infrastructure
* Tue May 14 2024 Than Ngo <than@redhat.com> - 3.7.0-1 * Tue May 14 2024 Than Ngo <than@redhat.com> - 3.7.0-1
- Resolves: RHEL-35274, rebase sap roles to version 1.3.7 - Resolves: RHEL-35274, rebase sap roles to version 1.3.7

View File

@ -1,2 +1,3 @@
SHA512 (auto-maintenance-e2a233f5a0cb68363798bf014b16552cca681bd0.tar.gz) = 3d5c784e668605eb8b7862227b456da05ff5dedf84411131a27118b501b6a9bbe8894c4f29e6de4230fe534ef6b2de4653c56a904857d9eb11b452d31aed143c SHA512 (auto-maintenance-e4e63cd408561b39e11d6285ab81f32a999719db.tar.gz) = 23e6774d2aa88e7a694f81c9f25d9e7a6a9d14abc4a2d5b15e4a4a0b078ba966d7ae396ca91d8ae92b0116f0b099e77aa7f4cc0c4d60a15a2c6bbfd24486ab86
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.2.tar.gz) = 2bf85c36745bae016c9b3e3f88f47baa834846b7bda3fcd5f036529dba70b56f21731953417c6f4fb72521f5bf614c87c25faf444429477fc0b6fd0b5ce617ad