Pick redfish_* modules from community.general
Code borrowed from rhel-system-roles. Resolves: rhbz2112434
This commit is contained in:
parent
78f38f8ec4
commit
27a40dfbc9
@ -21,7 +21,7 @@ Name: ansible-collection-%{collection_namespace}-%{collection_name}
|
|||||||
Url: https://github.com/pcahyna/fedora.linux_mgmt/
|
Url: https://github.com/pcahyna/fedora.linux_mgmt/
|
||||||
Summary: Ansible Collection of general system management and utility modules and other plugins
|
Summary: Ansible Collection of general system management and utility modules and other plugins
|
||||||
Version: 1.0.0
|
Version: 1.0.0
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
|
|
||||||
License: GPLv3+
|
License: GPLv3+
|
||||||
|
|
||||||
@ -62,6 +62,12 @@ Requires: ansible >= 2.9.10
|
|||||||
|
|
||||||
Source: https://github.com/pcahyna/fedora.linux_mgmt/archive/%{version}/%{archivename}.tar.gz
|
Source: https://github.com/pcahyna/fedora.linux_mgmt/archive/%{version}/%{archivename}.tar.gz
|
||||||
|
|
||||||
|
%if 0%{?rhel}
|
||||||
|
# Collection tarballs from Galaxy
|
||||||
|
# Not used on Fedora.
|
||||||
|
Source901: https://galaxy.ansible.com/download/community-general-5.4.0.tar.gz
|
||||||
|
%endif
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
BuildRequires: python3
|
BuildRequires: python3
|
||||||
@ -90,7 +96,34 @@ Collection artifact for %{name}. This package contains %{collection_namespace}-%
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{extractdir}
|
%if 0%{?rhel}
|
||||||
|
%setup -T -a 901 -c -n .external/community/general
|
||||||
|
%endif
|
||||||
|
%setup -n %{extractdir}
|
||||||
|
|
||||||
|
%if 0%{?rhel}
|
||||||
|
modules=( remote_management/redfish/redfish_{command,config,info}.py )
|
||||||
|
module_utils=( redfish_utils.py )
|
||||||
|
|
||||||
|
mkdir -p plugins/modules
|
||||||
|
mkdir -p plugins/module_utils
|
||||||
|
|
||||||
|
for dir in %{_builddir}/.external/*/*; do
|
||||||
|
name=$(basename "$dir")
|
||||||
|
ns=$(basename $(dirname "$dir"))
|
||||||
|
for module in "${modules[@]}"; do
|
||||||
|
cp -pL $dir/plugins/modules/$module plugins/modules/
|
||||||
|
done
|
||||||
|
for module_util in "${module_utils[@]}"; do
|
||||||
|
cp -pL $dir/plugins/module_utils/$module_util plugins/module_utils/$module_util
|
||||||
|
done
|
||||||
|
# Replacing original collection name by downstream (vendored) name
|
||||||
|
if [ "${ns}" != "%{collection_namespace}" ] || [ "${name}" != "%{collection_name}" ] ; then
|
||||||
|
find -type f -exec \
|
||||||
|
sed "s/${ns}[.]${name}/%{collection_namespace}.%{collection_name}/g" -i {} \;
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
%endif
|
||||||
|
|
||||||
# Replacing original (Galaxy) collection name by downstream (Automation Hub) name
|
# Replacing original (Galaxy) collection name by downstream (Automation Hub) name
|
||||||
%if "%{collection_namespace_orig}" != "%{collection_namespace}" || "%{collection_name_orig}" != "%{collection_name}"
|
%if "%{collection_namespace_orig}" != "%{collection_namespace}" || "%{collection_name_orig}" != "%{collection_name}"
|
||||||
@ -105,10 +138,17 @@ find -type f ! -executable -type f -name '*.py' -print -exec sed -i -e '1{\@^#!.
|
|||||||
mv galaxy.yml.new galaxy.yml
|
mv galaxy.yml.new galaxy.yml
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
mkdir -p .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
|
||||||
|
cp -a * .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
|
||||||
|
|
||||||
|
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
|
||||||
%ansible_collection_build
|
%ansible_collection_build
|
||||||
|
popd
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
|
||||||
%ansible_collection_install
|
%ansible_collection_install
|
||||||
|
popd
|
||||||
|
|
||||||
%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
|
||||||
|
Loading…
Reference in New Issue
Block a user