Compare commits
No commits in common. "c8s-private-than" and "c8" have entirely different histories.
c8s-privat
...
c8
13
.gitignore
vendored
13
.gitignore
vendored
@ -1,11 +1,2 @@
|
||||
/auto-maintenance-e2a233f5a0cb68363798bf014b16552cca681bd0.tar.gz
|
||||
/community.sap_install-f0deb287aaa0fb7d992b95a04b14e263b6690c23.tar.gz
|
||||
/prepare-redhat.sap_install-main.tar.bz2
|
||||
/community.sap_install-60f5f40497d54c46b0bd3f79ef1fef4ada148119.tar.gz
|
||||
/redhat.sap_install-1.3.4.tar.gz
|
||||
/redhat.sap_install-1.3.5.tar.gz
|
||||
/redhat.sap_install-1.3.7.tar.gz
|
||||
/auto-maintenance-1.108.0.tar.gz
|
||||
/redhat.sap_install-1.7.1.tar.gz
|
||||
/redhat.sap_infrastructure-1.1.3.tar.gz
|
||||
/build-tools-1.7.1.tar.gz
|
||||
SOURCES/auto-maintenance-e2a233f5a0cb68363798bf014b16552cca681bd0.tar.gz
|
||||
SOURCES/redhat.sap_install-1.3.5.tar.gz
|
||||
|
||||
2
.rhel-system-roles-sap.metadata
Normal file
2
.rhel-system-roles-sap.metadata
Normal file
@ -0,0 +1,2 @@
|
||||
584f8d1681adf13cb7af256a7b38d94ca80dcab2 SOURCES/auto-maintenance-e2a233f5a0cb68363798bf014b16552cca681bd0.tar.gz
|
||||
835376d0e4799989e9d4deb21ac7e1d335c941de SOURCES/redhat.sap_install-1.3.5.tar.gz
|
||||
1690
SOURCES/redhat.sap_install-1.3.4-add_tests.patch
Normal file
1690
SOURCES/redhat.sap_install-1.3.4-add_tests.patch
Normal file
File diff suppressed because it is too large
Load Diff
128
SOURCES/redhat.sap_install-1.3.4-add_tools.patch
Normal file
128
SOURCES/redhat.sap_install-1.3.4-add_tools.patch
Normal file
@ -0,0 +1,128 @@
|
||||
commit 83db825f7f30445408efa6061631d8dd0590e891
|
||||
Author: Than Ngo <than@redhat.com>
|
||||
Date: Thu Jan 25 16:17:21 2024 +0100
|
||||
|
||||
add missing tools folders
|
||||
|
||||
Signed-off-by: Than Ngo <than@redhat.com>
|
||||
|
||||
diff --git a/roles/sap_general_preconfigure/tools/beautify-assert-output.sh b/roles/sap_general_preconfigure/tools/beautify-assert-output.sh
|
||||
new file mode 100755
|
||||
index 0000000..f48087c
|
||||
--- /dev/null
|
||||
+++ b/roles/sap_general_preconfigure/tools/beautify-assert-output.sh
|
||||
@@ -0,0 +1,34 @@
|
||||
+#!/bin/bash
|
||||
+
|
||||
+# default font color: Light Cyan, which should be readable on both bright and dark background
|
||||
+__FONT_COLOR=36m
|
||||
+
|
||||
+if [[ ${1}. == "font_light_gray". ]]; then
|
||||
+ __FONT_COLOR=37m
|
||||
+elif [[ ${1}. == "font_no_color". ]]; then
|
||||
+ __FONT_COLOR=30m
|
||||
+fi
|
||||
+
|
||||
+if [[ ${2}. == "reset." ]]; then
|
||||
+ awk 'BEGIN{printf ("\033['${__FONT_COLOR}'Resetting font color\n")}'
|
||||
+ exit
|
||||
+fi
|
||||
+
|
||||
+awk '{sub (" \"msg\": ", "")}
|
||||
+ /TASK/{task_line=$0}
|
||||
+ /fatal:/{fatal_line=$0; nfatal[host]++}
|
||||
+ /...ignoring/{nfatal[host]--; if (nfatal[host]<0) nfatal[host]=0}
|
||||
+ /^[a-z]/&&/: \[/{gsub ("\\[", ""); gsub ("]", ""); gsub (":", ""); host=$2}
|
||||
+ /SAP note/{print "\033['${__FONT_COLOR}'[" host"] "$0}
|
||||
+ /FAIL:/{nfail[host]++; print "\033[31m[" host"] "$0}
|
||||
+ /WARN:/{nwarn[host]++; print "\033[33m[" host"] "$0}
|
||||
+ /PASS:/{npass[host]++; print "\033[32m[" host"] "$0}
|
||||
+ /INFO:/{print "\033[34m[" host"] "$0}
|
||||
+ /changed/&&/unreachable/{print "\033['${__FONT_COLOR}'[" host"] "$0}
|
||||
+ END{print ("---"); for (var in npass) {printf ("[%s] ", var); if (nfatal[var]>0) {
|
||||
+ printf ("\033[31mFATAL ERROR!!! Playbook might have been aborted!!!\033['${__FONT_COLOR}' Last TASK and fatal output:\n"); print task_line, fatal_line
|
||||
+ exit 199
|
||||
+ }
|
||||
+ else printf ("\033[31mFAIL: %d \033[33mWARN: %d \033[32mPASS: %d\033['${__FONT_COLOR}'\n", nfail[var], nwarn[var], npass[var])}
|
||||
+ if (nfail[var] != 0) exit (nfail[var])
|
||||
+ }'
|
||||
diff --git a/roles/sap_hana_preconfigure/tools/beautify-assert-output.sh b/roles/sap_hana_preconfigure/tools/beautify-assert-output.sh
|
||||
new file mode 100755
|
||||
index 0000000..f48087c
|
||||
--- /dev/null
|
||||
+++ b/roles/sap_hana_preconfigure/tools/beautify-assert-output.sh
|
||||
@@ -0,0 +1,34 @@
|
||||
+#!/bin/bash
|
||||
+
|
||||
+# default font color: Light Cyan, which should be readable on both bright and dark background
|
||||
+__FONT_COLOR=36m
|
||||
+
|
||||
+if [[ ${1}. == "font_light_gray". ]]; then
|
||||
+ __FONT_COLOR=37m
|
||||
+elif [[ ${1}. == "font_no_color". ]]; then
|
||||
+ __FONT_COLOR=30m
|
||||
+fi
|
||||
+
|
||||
+if [[ ${2}. == "reset." ]]; then
|
||||
+ awk 'BEGIN{printf ("\033['${__FONT_COLOR}'Resetting font color\n")}'
|
||||
+ exit
|
||||
+fi
|
||||
+
|
||||
+awk '{sub (" \"msg\": ", "")}
|
||||
+ /TASK/{task_line=$0}
|
||||
+ /fatal:/{fatal_line=$0; nfatal[host]++}
|
||||
+ /...ignoring/{nfatal[host]--; if (nfatal[host]<0) nfatal[host]=0}
|
||||
+ /^[a-z]/&&/: \[/{gsub ("\\[", ""); gsub ("]", ""); gsub (":", ""); host=$2}
|
||||
+ /SAP note/{print "\033['${__FONT_COLOR}'[" host"] "$0}
|
||||
+ /FAIL:/{nfail[host]++; print "\033[31m[" host"] "$0}
|
||||
+ /WARN:/{nwarn[host]++; print "\033[33m[" host"] "$0}
|
||||
+ /PASS:/{npass[host]++; print "\033[32m[" host"] "$0}
|
||||
+ /INFO:/{print "\033[34m[" host"] "$0}
|
||||
+ /changed/&&/unreachable/{print "\033['${__FONT_COLOR}'[" host"] "$0}
|
||||
+ END{print ("---"); for (var in npass) {printf ("[%s] ", var); if (nfatal[var]>0) {
|
||||
+ printf ("\033[31mFATAL ERROR!!! Playbook might have been aborted!!!\033['${__FONT_COLOR}' Last TASK and fatal output:\n"); print task_line, fatal_line
|
||||
+ exit 199
|
||||
+ }
|
||||
+ else printf ("\033[31mFAIL: %d \033[33mWARN: %d \033[32mPASS: %d\033['${__FONT_COLOR}'\n", nfail[var], nwarn[var], npass[var])}
|
||||
+ if (nfail[var] != 0) exit (nfail[var])
|
||||
+ }'
|
||||
diff --git a/roles/sap_netweaver_preconfigure/tools/beautify-assert-output.sh b/roles/sap_netweaver_preconfigure/tools/beautify-assert-output.sh
|
||||
new file mode 100755
|
||||
index 0000000..f48087c
|
||||
--- /dev/null
|
||||
+++ b/roles/sap_netweaver_preconfigure/tools/beautify-assert-output.sh
|
||||
@@ -0,0 +1,34 @@
|
||||
+#!/bin/bash
|
||||
+
|
||||
+# default font color: Light Cyan, which should be readable on both bright and dark background
|
||||
+__FONT_COLOR=36m
|
||||
+
|
||||
+if [[ ${1}. == "font_light_gray". ]]; then
|
||||
+ __FONT_COLOR=37m
|
||||
+elif [[ ${1}. == "font_no_color". ]]; then
|
||||
+ __FONT_COLOR=30m
|
||||
+fi
|
||||
+
|
||||
+if [[ ${2}. == "reset." ]]; then
|
||||
+ awk 'BEGIN{printf ("\033['${__FONT_COLOR}'Resetting font color\n")}'
|
||||
+ exit
|
||||
+fi
|
||||
+
|
||||
+awk '{sub (" \"msg\": ", "")}
|
||||
+ /TASK/{task_line=$0}
|
||||
+ /fatal:/{fatal_line=$0; nfatal[host]++}
|
||||
+ /...ignoring/{nfatal[host]--; if (nfatal[host]<0) nfatal[host]=0}
|
||||
+ /^[a-z]/&&/: \[/{gsub ("\\[", ""); gsub ("]", ""); gsub (":", ""); host=$2}
|
||||
+ /SAP note/{print "\033['${__FONT_COLOR}'[" host"] "$0}
|
||||
+ /FAIL:/{nfail[host]++; print "\033[31m[" host"] "$0}
|
||||
+ /WARN:/{nwarn[host]++; print "\033[33m[" host"] "$0}
|
||||
+ /PASS:/{npass[host]++; print "\033[32m[" host"] "$0}
|
||||
+ /INFO:/{print "\033[34m[" host"] "$0}
|
||||
+ /changed/&&/unreachable/{print "\033['${__FONT_COLOR}'[" host"] "$0}
|
||||
+ END{print ("---"); for (var in npass) {printf ("[%s] ", var); if (nfatal[var]>0) {
|
||||
+ printf ("\033[31mFATAL ERROR!!! Playbook might have been aborted!!!\033['${__FONT_COLOR}' Last TASK and fatal output:\n"); print task_line, fatal_line
|
||||
+ exit 199
|
||||
+ }
|
||||
+ else printf ("\033[31mFAIL: %d \033[33mWARN: %d \033[32mPASS: %d\033['${__FONT_COLOR}'\n", nfail[var], nwarn[var], npass[var])}
|
||||
+ if (nfail[var] != 0) exit (nfail[var])
|
||||
+ }'
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,80 +1,90 @@
|
||||
# disable collection_artifact by default
|
||||
%bcond_with collection_artifact
|
||||
|
||||
# disable collection by default since version 3.6.0 (1.3.5)
|
||||
# disable collection by default since version 3.6.0 (1.3.4)
|
||||
%bcond_with collection
|
||||
|
||||
# remove sap_vm_preconfigure from sap_infrastructure (since version 1.1.3)
|
||||
%global remove_sap_vm_preconfigure 1
|
||||
|
||||
%global collection_name_sap_install sap_install
|
||||
%global collection_name_sap_infrastructure sap_infrastructure
|
||||
%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}
|
||||
%global package_name rhel-system-roles-sap
|
||||
%define package_name rhel-system-roles-sap
|
||||
%global collection_namespace redhat
|
||||
%else
|
||||
%global package_name linux-system-roles-sap
|
||||
%define package_name linux-system-roles-sap
|
||||
%global collection_namespace community
|
||||
%endif
|
||||
|
||||
# collection_version has to be increased by every rebuild
|
||||
# otherwise, it cannot be uploaded to Automation Hub and Galaxy
|
||||
# due to version conflict
|
||||
%global collection_sap_install_version 1.7.1
|
||||
%global collection_sap_infrastructure_version 1.1.3
|
||||
%global build_tool_version 1.7.1
|
||||
%define collection_version 1.3.5
|
||||
|
||||
%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 1.108.0
|
||||
%global mainid_build_tools %{collection_sap_install_version}
|
||||
%global commit_id_sap_install %{collection_sap_install_version}
|
||||
%global commit_id_sap_infrastructure %{collection_sap_infrastructure_version}
|
||||
# roles sap_install, to get the list of supported roles: ls -l redhat.sap_install-*/roles/
|
||||
%global mainid e2a233f5a0cb68363798bf014b16552cca681bd0
|
||||
%global commit_id_sap_install %{collection_version}
|
||||
%global rolename1 sap_general_preconfigure
|
||||
%global rolename2 sap_ha_install_hana_hsr
|
||||
%global rolename3 sap_hana_install
|
||||
%global rolename4 sap_hana_preconfigure
|
||||
%global rolename5 sap_ha_pacemaker_cluster
|
||||
%global rolename6 sap_maintain_etc_hosts
|
||||
%global rolename6 sap_hypervisor_node_preconfigure
|
||||
%global rolename7 sap_netweaver_preconfigure
|
||||
%global rolename8 sap_swpm
|
||||
# roles sap_infrastructure, to get the list of supported roles: ls -l redhat.sap_infrastructure-*/roles/
|
||||
%global rolename20 sap_hypervisor_node_preconfigure
|
||||
%if %{remove_sap_vm_preconfigure}
|
||||
%global rolename21 %nil
|
||||
%else
|
||||
%global rolename21 sap_vm_preconfigure
|
||||
%endif
|
||||
%global rolename22 sap_vm_provision
|
||||
%global rolename9 sap_vm_preconfigure
|
||||
%global src_owner linux-system-roles
|
||||
%global github_repo_sap_install redhat.sap_install
|
||||
%global github_repo_sap_infrastructure redhat.sap_infrastructure
|
||||
%global rolename_sap_install %{rolename1} %{rolename2} %{rolename3} %{rolename4} %{rolename5} %{rolename6} %{rolename7} %{rolename8}
|
||||
%global rolename_sap_infrastructure %{rolename20} %{rolename21} %{rolename22}
|
||||
%global rolename_rhel %{rolename1} %{rolename2} %{rolename3} %{rolename4} %{rolename5} %{rolename6} %{rolename7} %{rolename8} %{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.7
|
||||
Release: 1%{?dist}
|
||||
Version: 3.6.0
|
||||
Release: 2%{?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
|
||||
Source3: https://github.com/ngothan/build-tools/archive/%{mainid_build_tools}/build-tools-%{mainid_build_tools}.tar.gz
|
||||
|
||||
# add collection files
|
||||
Patch1: redhat.sap_install-1.3.5-collections-files-324bfb8bab50d2baa1c4aacdb59e4e5c9e2ba74f.patch
|
||||
|
||||
# add tests files
|
||||
Patch2: redhat.sap_install-1.3.4-add_tests.patch
|
||||
|
||||
# add tools files
|
||||
Patch3: redhat.sap_install-1.3.4-add_tools.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
Requires: rhel-system-roles
|
||||
|
||||
BuildRequires: tar
|
||||
%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
|
||||
|
||||
%if %{with collection}
|
||||
# Requirements for galaxy_transform.py
|
||||
BuildRequires: python3
|
||||
%if 0%{?fedora} || 0%{?rhel} >= 8
|
||||
BuildRequires: python3dist(ruamel.yaml)
|
||||
Requires: python3-jmespath
|
||||
Requires: python3-netaddr
|
||||
%else
|
||||
BuildRequires: python3-ruamel-yaml
|
||||
Requires: python-jmespath
|
||||
Requires: python-netaddr
|
||||
%endif
|
||||
|
||||
# NOTE: ansible-core is in rhel-8.6 and newer, but not installable
|
||||
@ -85,20 +95,25 @@ BuildRequires: python3-ruamel-yaml
|
||||
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_sap_install}) = %{version}
|
||||
Provides: ansible-collection-%{collection_namespace}.%collection_name_sap_infrastructure} = %{version}
|
||||
Provides: ansible-collection(%{collection_namespace}.%{collection_name}) = %{version}
|
||||
%endif
|
||||
# be compatible with the usual Fedora Provides:
|
||||
Provides: ansible-collection-%{collection_namespace}-%{collection_name_sap_install} = %{version}-%{release}
|
||||
Provides: ansible-collection-%{collection_namespace}-%collection_name_sap_infrastructure} = %{version}-%{release}
|
||||
%endif
|
||||
Provides: ansible-collection-%{collection_namespace}-%{collection_name} = %{version}-%{release}
|
||||
|
||||
# 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_sap_install() ansible-galaxy collection install -n -p %{buildroot}%{_datadir}/ansible/collections %{collection_namespace}-%{collection_name_sap_install}-%{collection_sap_install_version}.tar.gz
|
||||
%define ansible_collection_infrastructure_install() ansible-galaxy collection install -n -p %{buildroot}%{_datadir}/ansible/collections %{collection_namespace}-%{collection_name_sap_infrastructure}-%{collection_sap_infrastructure_version}.tar.gz
|
||||
%define ansible_collection_install() ansible-galaxy collection install -n -p %{buildroot}%{_datadir}/ansible/collections %{collection_namespace}-%{collection_name}-%{collection_version}.tar.gz
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} >= 8
|
||||
%{!?ansible_collection_files:%define ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/}
|
||||
%else
|
||||
%if %{?ansible_collection_files:0}%{!?ansible_collection_files:1}
|
||||
%define ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%description
|
||||
Collection of Ansible roles which configures a RHEL system according
|
||||
@ -109,22 +124,19 @@ 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_sap_install}-%{collection_sap_install_version}.tar.gz
|
||||
* %{collection_namespace}-%{collection_name_sap_infrastructure}-%{collection_sap_infrastructure_version}.tar.gz
|
||||
Collection artifact for %{name}. This package contains %{collection_namespace}-%{collection_name}-%{collection_version}.tar.gz
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%setup -q -a1 -a2 -a3 -n auto-maintenance-%{mainid}
|
||||
%setup -q -a1 -n auto-maintenance-%{mainid}
|
||||
|
||||
# unpack collection tar files
|
||||
%if %{without collection}
|
||||
mkdir -p %{collection_dir_sap_install} %{collection_dir_sap_infrastructure}
|
||||
# sap_install collection
|
||||
tar xf %{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 xf %{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
|
||||
pushd %{github_repo_sap_install}-%{commit_id_sap_install}/
|
||||
%patch -P1 -p1
|
||||
%patch -P2 -p1
|
||||
%patch -P3 -p1
|
||||
# workaround for md2html error
|
||||
sed -i -e "s|for POWER ||g" roles/sap_hana_preconfigure/README.md
|
||||
popd
|
||||
|
||||
# remove zero file and symlinks
|
||||
find . -type f -size 0 -delete
|
||||
@ -133,49 +145,42 @@ find . -type l -delete
|
||||
# fix python and bash shebangs
|
||||
find -type f \( -iname "*.py" \) -exec sed -i '1s=^#! */usr/bin/\(python\|env python\)[23]\?=#!/usr/bin/python3=' {} +
|
||||
find -type f \( -iname "*.sh" \) -exec sed -i '1s=^#! */bin/bash=#!/usr/bin/bash=' {} +
|
||||
find -type f \( -iname "*.sh" \) -exec sed -i '1s=^#! */usr/bin/env bash=#!/usr/bin/bash=' {} +
|
||||
|
||||
# remove json files, these are already present in the collection subdirectory
|
||||
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
|
||||
|
||||
for role in %{rolename_sap_install} ; do
|
||||
echo "Handling role $role..."
|
||||
python3 lsr_role2collection.py --role "$role" \
|
||||
for role in %{rolenames} ; 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} \
|
||||
--dest-path .collections \
|
||||
--namespace %{collection_namespace} \
|
||||
--collection %{collection_name_sap_install} \
|
||||
--new-role "$role"
|
||||
--collection %{collection_name} \
|
||||
--new-role "$new_role"
|
||||
done
|
||||
|
||||
for role in %{rolename_sap_infrastructure} ; do
|
||||
echo "Handling role $role..."
|
||||
python3 lsr_role2collection.py --role "$role" \
|
||||
--src-path %{github_repo_sap_infrastructure}-%{commit_id_sap_infrastructure}/roles/"$role" \
|
||||
--src-owner %{src_owner} \
|
||||
--dest-path .collections \
|
||||
--namespace %{collection_namespace} \
|
||||
--collection %{collection_name_sap_infrastructure} \
|
||||
--new-role "$role"
|
||||
done
|
||||
cp -p galaxy.yml .collections/ansible_collections/%{collection_namespace}/%{collection_name}
|
||||
# update README.md
|
||||
cp %{github_repo_sap_install}-%{commit_id_sap_install}/README.md .collections/ansible_collections/%{collection_namespace}/%{collection_name}
|
||||
|
||||
# update galaxy.yml
|
||||
cp -av %{github_repo_sap_install}-%{commit_id_sap_install}/galaxy.yml .collections/ansible_collections/%{collection_namespace}/%{collection_name_sap_install}/
|
||||
cp -av %{github_repo_sap_infrastructure}-%{commit_id_sap_infrastructure}/galaxy.yml .collections/ansible_collections/%{collection_namespace}/%{collection_name_sap_infrastructure}/
|
||||
|
||||
# Build the sap_install collection
|
||||
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name_sap_install}/
|
||||
# Build the collection
|
||||
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
|
||||
%ansible_collection_build
|
||||
popd
|
||||
|
||||
# Build the sap_infrastructure collection
|
||||
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name_sap_infrastructure}/
|
||||
%ansible_collection_build
|
||||
popd
|
||||
%endif
|
||||
|
||||
%install
|
||||
@ -184,67 +189,53 @@ mkdir -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles \
|
||||
|
||||
# create file selection for documents
|
||||
echo "%dir %{_pkgdocdir}" > files_section.txt
|
||||
cp -afv %{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
|
||||
|
||||
# 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 \
|
||||
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 \
|
||||
$RPM_BUILD_ROOT%{_pkgdocdir}/$role/
|
||||
echo "%dir %{_pkgdocdir}/$role" >> files_section.txt
|
||||
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/
|
||||
echo "%dir %{_pkgdocdir}/$role" >> files_section.txt
|
||||
%endif
|
||||
echo "%dir %{_pkgdocdir}/$role" >> files_section.txt
|
||||
done
|
||||
|
||||
# install collection files
|
||||
%if %{with collection}
|
||||
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name_sap_install}/
|
||||
%ansible_collection_sap_install
|
||||
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
|
||||
%ansible_collection_install
|
||||
popd
|
||||
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name_sap_infrastructure}/
|
||||
%ansible_collection_infrastructure_install
|
||||
popd
|
||||
# update CHANGELOG.rst playbooks FILES.json README.md MANIFEST.json
|
||||
for f in CHANGELOG.rst playbooks FILES.json README.md MANIFEST.json ; do
|
||||
cp -afv %{github_repo_sap_install}-%{commit_id_sap_install}/$f $RPM_BUILD_ROOT/%{ansible_collection_files}/%{collection_name_sap_install}/
|
||||
cp -afv %{github_repo_sap_infrastructure}-%{commit_id_sap_infrastructure}/$f $RPM_BUILD_ROOT/%{ansible_collection_files}/%{collection_name_sap_infrastructure}/
|
||||
done
|
||||
%else
|
||||
cp -pR collections $RPM_BUILD_ROOT%{_datadir}/ansible/
|
||||
cp -pR %{github_repo_sap_install}-%{commit_id_sap_install}/collections $RPM_BUILD_ROOT%{_datadir}/ansible/
|
||||
%endif
|
||||
|
||||
# install collection_artifact
|
||||
%if %{with collection_artifact}
|
||||
# Copy collection artifact to /usr/share/ansible/collections/ for collection-artifact
|
||||
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name_sap_install}/
|
||||
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/
|
||||
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
|
||||
mv %{collection_namespace}-%{collection_name}-%{collection_version}.tar.gz $RPM_BUILD_ROOT%{_datadir}/ansible/collections/
|
||||
popd
|
||||
%endif
|
||||
|
||||
|
||||
%files -f files_section.txt
|
||||
%dir %{_datadir}/ansible
|
||||
%dir %{_datadir}/ansible/roles
|
||||
%doc %{_pkgdocdir}/*/README.md
|
||||
%license %{_pkgdocdir}/*/LICENSE
|
||||
%{_datadir}/ansible/roles/*
|
||||
|
||||
%if %{with html}
|
||||
%{_pkgdocdir}/*/README.html
|
||||
%endif
|
||||
%if %{with collection}
|
||||
%{ansible_collection_files}
|
||||
%else
|
||||
@ -252,23 +243,10 @@ popd
|
||||
%endif
|
||||
%if %{with collection_artifact}
|
||||
%files collection-artifact
|
||||
%{_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
|
||||
%{_datadir}/ansible/collections/%{collection_namespace}-%{collection_name}-%{collection_version}.tar.gz
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Mon Oct 13 2025 Than Ngo <than@redhat.com> - 3.8.7-1
|
||||
- Include sap_infrastructure-1.1.3 and sap_install-1.7.1
|
||||
- Fix findings found by SAST
|
||||
- Remove unwanted dependencies
|
||||
Resolves: RHEL-115432
|
||||
|
||||
* Wed Apr 02 2025 Than Ngo <than@redhat.com> - 3.7.0-2
|
||||
- Resolves: RHEL-84509, Add support for 8.10
|
||||
|
||||
* Wed May 15 2024 Than Ngo <than@redhat.com> - 3.7.0-1
|
||||
- Resolves: RHEL-34812, update to 1.3.7
|
||||
|
||||
* Mon Feb 05 2024 Than Ngo <than@redhat.com> - 3.6.0-2
|
||||
- sap_hypervisor_node_preconfigure: fix for role name and path for included tasks
|
||||
- update collection files
|
||||
@ -1,6 +0,0 @@
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-8
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
|
||||
4
sources
4
sources
@ -1,4 +0,0 @@
|
||||
SHA512 (auto-maintenance-1.108.0.tar.gz) = 9dedac13ab05113ca474476189b57f6cc9aa12ff07a0acf7f4a0b56ff7b06c5cb84f10e2979a62cc3e94490b00d7032c035ee32e73d6025a5a0a6183b8ccc478
|
||||
SHA512 (redhat.sap_install-1.7.1.tar.gz) = 11032cd7776f6031b2c13921bf88f8a0a9aa69cb6f82d5f8a1c98210960ddaa5a377f9f5865a218821b982e45826e1970b43845a383666858a14ec9a93ed608e
|
||||
SHA512 (redhat.sap_infrastructure-1.1.3.tar.gz) = 4896542bd4a94e4637bf10725dbe1174f02338edbf6443ba1144e211eedd7b5433b66032ae530bbcf5b90521e269ee143e0e440cb952b94c2586f804e8668f41
|
||||
SHA512 (build-tools-1.7.1.tar.gz) = ceddd2434a72dbb696c347746b789898c23a31f2c19b8366f69e977a118e26f07eb8d9eca63c6bc5bd45e0b88e473050f88805e38fe61019bca3a30d29e22e16
|
||||
Loading…
Reference in New Issue
Block a user