Compare commits
10 Commits
4c5b0baeda
...
13c3e2d2d7
Author | SHA1 | Date | |
---|---|---|---|
|
13c3e2d2d7 | ||
|
b7d92e146f | ||
|
1c1511bdfc | ||
|
6b756590a3 | ||
|
8cf9810759 | ||
|
201700f72e | ||
|
27a40dfbc9 | ||
|
78f38f8ec4 | ||
|
1c80434482 | ||
|
b4b2964c0d |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
/ansible-collection-fedora-linux_mgmt.tar.gz
|
/ansible-collection-fedora-linux_mgmt.tar.gz
|
||||||
/fedora.linux_mgmt-1.0.0.tar.gz
|
/fedora.linux_mgmt-1.0.0.tar.gz
|
||||||
|
/community-general-5.4.0.tar.gz
|
||||||
|
@ -4,8 +4,11 @@
|
|||||||
%bcond_without ansible
|
%bcond_without ansible
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%bcond_with collection_artifact
|
||||||
|
|
||||||
%global collection_namespace_orig fedora
|
%global collection_namespace_orig fedora
|
||||||
%global collection_name_orig linux_mgmt
|
%global collection_name_orig linux_mgmt
|
||||||
|
%global collection_version_orig 1.0.0
|
||||||
|
|
||||||
%if 0%{?rhel}
|
%if 0%{?rhel}
|
||||||
%global collection_namespace redhat
|
%global collection_namespace redhat
|
||||||
@ -18,13 +21,13 @@
|
|||||||
Name: ansible-collection-%{collection_namespace}-%{collection_name}
|
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.1.0
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
|
|
||||||
License: GPLv3+
|
License: GPLv3+
|
||||||
|
|
||||||
%global collection_version %{version}
|
%global collection_version %{version}
|
||||||
%global archivename %{collection_namespace_orig}.%{collection_name_orig}-%{version}
|
%global archivename %{collection_namespace_orig}.%{collection_name_orig}-%{collection_version_orig}
|
||||||
%global extractdir %{archivename}
|
%global extractdir %{archivename}
|
||||||
|
|
||||||
# Helper macros originally from macros.ansible by Igor Raits <ignatenkobrain>
|
# Helper macros originally from macros.ansible by Igor Raits <ignatenkobrain>
|
||||||
@ -33,7 +36,7 @@ License: GPLv3+
|
|||||||
# Not used (yet). Could be made to point to AH in RHEL - but what about CentOS Stream?
|
# Not used (yet). Could be made to point to AH in RHEL - but what about CentOS Stream?
|
||||||
#%%{!?ansible_collection_url:%%define ansible_collection_url() https://galaxy.ansible.com/%%{collection_namespace}/%%{collection_name}}
|
#%%{!?ansible_collection_url:%%define ansible_collection_url() https://galaxy.ansible.com/%%{collection_namespace}/%%{collection_name}}
|
||||||
|
|
||||||
%{!?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}}
|
||||||
|
|
||||||
%if %{with ansible}
|
%if %{with ansible}
|
||||||
BuildRequires: ansible >= 2.9.10
|
BuildRequires: ansible >= 2.9.10
|
||||||
@ -58,7 +61,13 @@ Requires: ansible >= 2.9.10
|
|||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
Source: https://github.com/pcahyna/fedora.linux_mgmt/archive/%{version}/%{archivename}.tar.gz
|
Source: https://github.com/pcahyna/fedora.linux_mgmt/archive/%{collection_version_orig}/%{archivename}.tar.gz
|
||||||
|
|
||||||
|
# Collection tarballs from Galaxy
|
||||||
|
# Not used on Fedora.
|
||||||
|
Source901: https://galaxy.ansible.com/download/community-general-5.4.0.tar.gz
|
||||||
|
|
||||||
|
Patch1: redfish-metadata.patch
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
@ -79,8 +88,52 @@ Provides: ansible-collection(%{collection_namespace}.%{collection_name}) = %{col
|
|||||||
%{summary}.
|
%{summary}.
|
||||||
Targeted at GNU/Linux systems.
|
Targeted at GNU/Linux systems.
|
||||||
|
|
||||||
|
%if %{with collection_artifact}
|
||||||
|
%package collection-artifact
|
||||||
|
Summary: Collection artifact to import to Automation Hub / Ansible Galaxy
|
||||||
|
|
||||||
|
%description collection-artifact
|
||||||
|
Collection artifact for %{name}. This package contains %{collection_namespace}-%{collection_name}-%{version}.tar.gz
|
||||||
|
%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}
|
||||||
|
%patch1 -p1
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%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
|
||||||
|
dest_module=plugins/modules/$(basename $module)
|
||||||
|
cp -pL $dir/plugins/modules/$module $dest_module
|
||||||
|
# Replacing original collection name by downstream (vendored) name
|
||||||
|
if [ "${ns}" != "%{collection_namespace}" ] || [ "${name}" != "%{collection_name}" ] ; then
|
||||||
|
sed "s/${ns}[.]${name}/%{collection_namespace}.%{collection_name}/g" -i $dest_module
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
for module_util in "${module_utils[@]}"; do
|
||||||
|
dest_module_util=plugins/module_utils/$module_util
|
||||||
|
cp -pL $dir/plugins/module_utils/$module_util $dest_module_util
|
||||||
|
# Replacing original collection name by downstream (vendored) name
|
||||||
|
if [ "${ns}" != "%{collection_namespace}" ] || [ "${name}" != "%{collection_name}" ] ; then
|
||||||
|
sed "s/${ns}[.]${name}/%{collection_namespace}.%{collection_name}/g" -i $dest_module_util
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
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}"
|
||||||
@ -91,20 +144,45 @@ find -type f -exec \
|
|||||||
# borrowed from from ansible-collection-ansible-netcommon
|
# borrowed from from ansible-collection-ansible-netcommon
|
||||||
find -type f ! -executable -type f -name '*.py' -print -exec sed -i -e '1{\@^#!.*@d}' '{}' +
|
find -type f ! -executable -type f -name '*.py' -print -exec sed -i -e '1{\@^#!.*@d}' '{}' +
|
||||||
|
|
||||||
%{SOURCE1} %{collection_namespace} %{collection_name} %{collection_version} > galaxy.yml.new
|
|
||||||
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}/
|
||||||
|
%{SOURCE1} %{collection_namespace} %{collection_name} %{collection_version} > .collections/ansible_collections/%{collection_namespace}/%{collection_name}/galaxy.yml
|
||||||
|
|
||||||
|
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}
|
||||||
|
# Copy collection artifact to /usr/share/ansible/collections/ for collection-artifact
|
||||||
|
if [ -f %{collection_namespace}-%{collection_name}-%{version}.tar.gz ]; then
|
||||||
|
mv %{collection_namespace}-%{collection_name}-%{version}.tar.gz \
|
||||||
|
$RPM_BUILD_ROOT%{_datadir}/ansible/collections/
|
||||||
|
fi
|
||||||
|
%endif
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%dir %{_datadir}/ansible
|
%dir %{_datadir}/ansible
|
||||||
%license COPYING
|
%license COPYING
|
||||||
%{ansible_collection_files}
|
%{ansible_collection_files}
|
||||||
|
|
||||||
|
%if %{with collection_artifact}
|
||||||
|
%files collection-artifact
|
||||||
|
%{_datadir}/ansible/collections/%{collection_namespace}-%{collection_name}-%{version}.tar.gz
|
||||||
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Aug 19 2022 Pavel Cahyna <pcahyna@redhat.com> - 1.1.0-2
|
||||||
|
- Add redfish_* modules from community.general
|
||||||
|
|
||||||
|
* Thu Aug 26 2021 Pavel Cahyna <pcahyna@redhat.com> - 1.0.0-2
|
||||||
|
- Create collection artifact subpackage, disabled by default
|
||||||
|
Taken from rhel-system-roles.
|
||||||
|
|
||||||
* Thu Aug 05 2021 Pavel Cahyna <pcahyna@redhat.com> - 1.0.0-1
|
* Thu Aug 05 2021 Pavel Cahyna <pcahyna@redhat.com> - 1.0.0-1
|
||||||
- Initial version
|
- Initial version
|
||||||
|
6
gating.yaml
Normal file
6
gating.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
--- !Policy
|
||||||
|
product_versions:
|
||||||
|
- rhel-9
|
||||||
|
decision_context: osci_compose_gate
|
||||||
|
rules:
|
||||||
|
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
|
20
redfish-metadata.patch
Normal file
20
redfish-metadata.patch
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
diff -up fedora.linux_mgmt-1.0.0/galaxy.yml~ fedora.linux_mgmt-1.0.0/galaxy.yml
|
||||||
|
--- fedora.linux_mgmt-1.0.0/galaxy.yml~ 2022-08-18 15:51:16.694699074 +0200
|
||||||
|
+++ fedora.linux_mgmt-1.0.0/galaxy.yml 2022-08-18 15:54:51.257016538 +0200
|
||||||
|
@@ -19,6 +19,7 @@ readme: README.md
|
||||||
|
authors:
|
||||||
|
- Pavel Cahyna <pcahyna@redhat.com>
|
||||||
|
- Bulat Gaifullin (@bgaifullin) <gaifullinbf@gmail.com>
|
||||||
|
+- Jose Delarosa (@jose-delarosa)
|
||||||
|
|
||||||
|
### OPTIONAL but strongly recommended
|
||||||
|
|
||||||
|
@@ -32,7 +33,7 @@ license:
|
||||||
|
|
||||||
|
# A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character
|
||||||
|
# requirements as 'namespace' and 'name'
|
||||||
|
-tags: [ipmi, linux]
|
||||||
|
+tags: [ipmi, redfish, linux]
|
||||||
|
|
||||||
|
# Collections that this collection requires to be installed for it to be usable. The key of the dict is the
|
||||||
|
# collection label 'namespace.name'. The value is a version range
|
1
sources
1
sources
@ -1 +1,2 @@
|
|||||||
SHA512 (fedora.linux_mgmt-1.0.0.tar.gz) = b24b1e98bd21119f21d47ffcff47a3325cb0ab38ee5a7b241990fe28eb8b1146c0ae1b22cad3fa5c733f12950f4620bb690ebb03ca07b2b23cd34c63e6f06922
|
SHA512 (fedora.linux_mgmt-1.0.0.tar.gz) = b24b1e98bd21119f21d47ffcff47a3325cb0ab38ee5a7b241990fe28eb8b1146c0ae1b22cad3fa5c733f12950f4620bb690ebb03ca07b2b23cd34c63e6f06922
|
||||||
|
SHA512 (community-general-5.4.0.tar.gz) = 2f117b3788e68b163f031c4afe549f1755edfc0686ec905367c7c978335bb4718fd271d93467f067152d2c853147df3515bbb247e6d794bb5f7c358fecb0aee8
|
||||||
|
Loading…
Reference in New Issue
Block a user