From d9a73c5e83262ce4e599a4ab9f09f8aff9f384e8 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Tue, 28 Jan 2025 13:09:26 +0100 Subject: [PATCH] Related: RHEL-74075, update redhat.sap_install to 1.5.2 --- .gitignore | 1 + rhel-system-roles-sap.spec | 77 ++++++++++++++++++++------------------ sources | 2 +- 3 files changed, 43 insertions(+), 37 deletions(-) diff --git a/.gitignore b/.gitignore index 6a15662..e772a21 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ /redhat.sap_install-1.3.7.tar.gz /redhat.sap_install-1.5.1.tar.gz /redhat.sap_infrastructure-1.1.1.tar.gz +/redhat.sap_install-1.5.2.tar.gz diff --git a/rhel-system-roles-sap.spec b/rhel-system-roles-sap.spec index 483ff02..1f6c825 100644 --- a/rhel-system-roles-sap.spec +++ b/rhel-system-roles-sap.spec @@ -4,7 +4,9 @@ # disable collection by default since version 3.6.0 (1.3.5) %bcond_with collection -%global collection_name sap_install +%global collection_name_sap_install sap_install +%global collection_name_sap_infrastructure sap_infrastructure + %if 0%{?rhel} %define package_name rhel-system-roles-sap %global collection_namespace redhat @@ -16,10 +18,11 @@ # 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_sap_install_version 1.5.1 +%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 collection_dir_sap_infrastructure collections/ansible_collections/%{collection_namespace}/%{collection_name_sap_infrastructure} %global mainid e2a233f5a0cb68363798bf014b16552cca681bd0 %global commit_id_sap_install %{collection_sap_install_version} %global commit_id_sap_infrastructure %{collection_sap_infrastructure_version} @@ -36,12 +39,13 @@ %global src_owner linux-system-roles %global github_repo_sap_install redhat.sap_install %global github_repo_sap_infrastructure redhat.sap_infrastructure -%global rolename_rhel %{rolename1} %{rolename2} %{rolename3} %{rolename4} %{rolename5} %{rolename6} %{rolename7} %{rolename8} %{rolename9} %{rolename10} +%global rolename_sap_install %{rolename1} %{rolename2} %{rolename3} %{rolename4} %{rolename5} %{rolename7} %{rolename8} %{rolename10} +%global rolename_sap_infrastructure %{rolename6} %{rolename9} %global rolenames %{rolename_rhel} Name: %{package_name} Summary: System Roles to configure RHEL for running SAP NetWeaver- or SAP HANA-based products -Version: 3.8.0 +Version: 3.8.1 Release: 1%{?dist} License: GPL-3.0-or-later Url: https://github.com/redhat-sap/community.sap_install @@ -81,13 +85,12 @@ Requires: python-netaddr BuildRequires: ansible-core >= 2.11.0 Requires: (ansible-core >= 2.11.0 or ansible >= 2.9.0) %endif -%endif - %if %{undefined __ansible_provides} Provides: ansible-collection(%{collection_namespace}.%{collection_name}) = %{version} %endif # be compatible with the usual Fedora Provides: 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. %define ansible_collection_build() ansible-galaxy collection build @@ -110,7 +113,9 @@ 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_sap_install_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 %prep @@ -119,19 +124,17 @@ Collection artifact for %{name}. This package contains %{collection_namespace}-% pushd %{github_repo_sap_install}-%{commit_id_sap_install}/ %patch -P1 -p1 %patch -P2 -p1 +popd # unpack collection tar file %if %{without collection} -mkdir -p %{collection_dir} -tar zxf redhat-sap_install-%{collection_sap_install_version}.tar.gz -C %{collection_dir} +mkdir -p %{collection_dir_sap_install} %{collection_dir_sap_infrastructure} +# 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 -# 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 find . -type f -size 0 -delete find . -type l -delete @@ -148,7 +151,7 @@ rm -f FILES.json MANIFEST.json # create dest-path 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" \ --src-path %{github_repo_sap_install}-%{commit_id_sap_install}/roles/"$role" \ --src-owner %{src_owner} \ @@ -166,7 +169,6 @@ cp %{github_repo_sap_install}-%{commit_id_sap_install}/README.md .collections/an pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/ %ansible_collection_build popd - %endif %install @@ -177,22 +179,26 @@ mkdir -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles \ 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/ - install -m 644 %{github_repo_sap_install}-%{commit_id_sap_install}/LICENSE \ - %{github_repo_sap_install}-%{commit_id_sap_install}/roles/$role/README.md \ - $RPM_BUILD_ROOT%{_pkgdocdir}/$role/ -%if %{with html} -install -m 644 %{github_repo_sap_install}-%{commit_id_sap_install}/roles/$role/README.html \ +# install sap_install roles +for role in %{rolename_sap_install} ; 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/ + install -m 644 %{github_repo_sap_install}-%{commit_id_sap_install}/LICENSE \ + %{github_repo_sap_install}-%{commit_id_sap_install}/roles/$role/README.md \ $RPM_BUILD_ROOT%{_pkgdocdir}/$role/ -%endif - echo "%dir %{_pkgdocdir}/$role" >> files_section.txt + echo "%dir %{_pkgdocdir}/$role" >> files_section.txt +done + +# install sap_infrastructure +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/ + echo "%dir %{_pkgdocdir}/$role" >> files_section.txt done # install collection files @@ -201,7 +207,7 @@ pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name %ansible_collection_install popd %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 # install collection_artifact @@ -218,10 +224,6 @@ popd %doc %{_pkgdocdir}/*/README.md %license %{_pkgdocdir}/*/LICENSE %{_datadir}/ansible/roles/* - -%if %{with html} -%{_pkgdocdir}/*/README.html -%endif %if %{with collection} %{ansible_collection_files} %else @@ -233,6 +235,9 @@ popd %endif %changelog +* Tue Jan 28 2025 Than Ngo - 3.8.1-1 +- Related: RHEL-74075, update redhat.sap_install to 1.5.2 + * Mon Jan 20 2025 Than Ngo - 3.8.0-1 - Resolves: RHEL-74075, new collcection redhat.sap_install and redhat.sap_infrastructure diff --git a/sources b/sources index ead5fcf..006fef4 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ SHA512 (auto-maintenance-e2a233f5a0cb68363798bf014b16552cca681bd0.tar.gz) = 3d5c784e668605eb8b7862227b456da05ff5dedf84411131a27118b501b6a9bbe8894c4f29e6de4230fe534ef6b2de4653c56a904857d9eb11b452d31aed143c SHA512 (redhat.sap_infrastructure-1.1.1.tar.gz) = 88ad3be52aec71b5fddf900071911e04cbda1b8f225a86c4fea91188b259d6bded1b3423a8b4278123dd1bcf5efad47be937266534332c81abe50f2f6bb18964 -SHA512 (redhat.sap_install-1.5.1.tar.gz) = e0a3681463b21d214f420305e080877e099aff108202f2a6b34c281e69c3a1bac86ed74da7587bfa96c36fdd5c20b52887b2b7d264d85f812abbc1e60e6c150d +SHA512 (redhat.sap_install-1.5.2.tar.gz) = ce1e25f4deb0169c0b541825bc6e58f6d56fe5fc69f8399979aa27c1d2e6b64efb7c9ca752ceed3c744aedb82d12cb8ccd415f5ae6d1e2690e047ed81cfefba8