Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43eaf6c1e8 | ||
|
|
c65ec7762e | ||
|
|
69ab5344ce | ||
|
|
ab2c4297f6 | ||
|
|
31b3adf686 | ||
|
|
234c8d86b1 | ||
|
|
b025e16db8 |
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/infra.leapp-16366d556dc7863853b8c1566553e72ad485941d.tar.gz
|
||||
/infra.leapp-1.7.0.tar.gz
|
||||
/infra.leapp-7a4bab008a8045c54b3477ab64766dd39a3273cd.tar.gz
|
||||
/infra.leapp-1.7.4.tar.gz
|
||||
@ -1,2 +0,0 @@
|
||||
# Package Not Available
|
||||
This package is not available on CentOS Stream 10.
|
||||
156
ansible-collection-redhat-leapp.spec
Normal file
156
ansible-collection-redhat-leapp.spec
Normal file
@ -0,0 +1,156 @@
|
||||
%bcond_with collection_artifact
|
||||
|
||||
Name: ansible-collection-redhat-leapp
|
||||
Version: 1.7.4
|
||||
Release: 1%{?dist}
|
||||
Summary: redhat.leapp Ansible collection that handles RHEL upgrades
|
||||
License: MIT
|
||||
URL: https://github.com/redhat-cop/infra.leapp
|
||||
|
||||
%global github_name infra.leapp
|
||||
|
||||
# Use either hash or tag for sourceid
|
||||
%global sourceid %%{version}
|
||||
# %%global sourceid 7e8e6170e458b875dc569b418b9982b8f11c8119
|
||||
%global source_path %{github_name}-%{sourceid}
|
||||
Source: %{url}/archive/%{sourceid}/%{source_path}.tar.gz
|
||||
|
||||
%global collection_namespace redhat
|
||||
%global collection_name leapp
|
||||
%global collection_version %{version}
|
||||
%global collection_dest_path .collections
|
||||
%global collection_build_path %{collection_dest_path}/ansible_collections/%{collection_namespace}/%{collection_name}
|
||||
%global collection_build_path %{github_name}-%{sourceid}/%{collection_namespace}-%{leapp}-%{version}.tar.gz
|
||||
|
||||
# Helper macros because ansible-packaging is not available in RHEL buildroot
|
||||
Source1001: ansible-packaging.inc
|
||||
%include %{SOURCE1001}
|
||||
|
||||
BuildRequires: ansible-core
|
||||
|
||||
BuildArch: noarch
|
||||
Requires: ansible-core
|
||||
Requires: rhel-system-roles
|
||||
|
||||
%description
|
||||
%{summary}.
|
||||
|
||||
%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
|
||||
%autosetup -n %{source_path} -p1
|
||||
|
||||
find -type f ! -executable -name '*.py' -exec \
|
||||
sed -i -e '1{\@^#!.*@d}' '{}' +
|
||||
find . -type f -exec \
|
||||
sed -e "s/infra\.leapp/redhat.leapp/g" \
|
||||
-e "s/leapp_system_roles_collection: fedora.linux_system_roles/leapp_system_roles_collection: redhat.rhel_system_roles/g" \
|
||||
-e "s/default('fedora.linux_system_roles')/default('redhat.rhel_system_roles')/g" \
|
||||
-e "s/| fedora.linux_system_roles |/| redhat.rhel_system_roles |/g" \
|
||||
-i {} \;
|
||||
|
||||
sed -i -e 's/namespace\: infra/namespace: redhat/g' \
|
||||
-e 's/version: .*/version: %{version}/g' \
|
||||
galaxy.yml
|
||||
|
||||
%build
|
||||
%ansible_collection_build
|
||||
|
||||
%install
|
||||
%ansible_collection_install
|
||||
|
||||
%if %{with collection_artifact}
|
||||
# Copy collection artifact to /usr/share/ansible/collections/
|
||||
mv %{collection_namespace}-%{collection_name}-%{version}.tar.gz \
|
||||
%{buildroot}%{_datadir}/ansible/collections/
|
||||
%endif
|
||||
|
||||
# Generate the %%files section in files_section.txt
|
||||
# Bulk files inclusion is not possible because roles store doc and licence
|
||||
# files together with other files
|
||||
format_item_for_files() {
|
||||
# $1 is directory or file name in buildroot
|
||||
# $2 - if true, and item is a directory, use %%dir
|
||||
local item
|
||||
local files_item
|
||||
item="$1" # full path including buildroot
|
||||
files_item=${item##"%{buildroot}"} # path with cut buildroot to be added to %%files
|
||||
if [ -L "$item" ]; then
|
||||
echo "$files_item"
|
||||
elif [ -d "$item" ]; then
|
||||
if [[ "$item" == */doc* ]]; then
|
||||
echo "%doc $files_item"
|
||||
elif [ "${2:-false}" = true ]; then
|
||||
echo "%dir $files_item"
|
||||
else
|
||||
echo "$files_item"
|
||||
fi
|
||||
elif [[ "$item" == */README.md ]] || [[ "$item" == */README.html ]] || [[ "$item" == */CHANGELOG.md ]]; then
|
||||
if [[ "$item" == */private_* ]]; then
|
||||
# mark as regular file, not %%doc
|
||||
echo "$files_item"
|
||||
else
|
||||
echo "%doc $files_item"
|
||||
fi
|
||||
elif [[ "$item" == */COPYING* ]] || [[ "$item" == */LICENSE* ]]; then
|
||||
echo "%""%""license" "$files_item"
|
||||
else
|
||||
echo "$files_item"
|
||||
fi
|
||||
}
|
||||
|
||||
files_section=files_section.txt
|
||||
rm -f $files_section
|
||||
touch $files_section
|
||||
# Dynamically generate files section entries for %%{ansible_collection_files}
|
||||
find %{buildroot}%{ansible_collection_files}%{collection_name} -mindepth 1 -maxdepth 1 | \
|
||||
while read item; do
|
||||
if [[ "$item" == */roles ]]; then
|
||||
format_item_for_files "$item" true >> $files_section
|
||||
find "$item" -mindepth 1 -maxdepth 1 | while read roles_dir; do
|
||||
format_item_for_files "$roles_dir" true >> $files_section
|
||||
find "$roles_dir" -mindepth 1 -maxdepth 1 | while read roles_item; do
|
||||
format_item_for_files "$roles_item" >> $files_section
|
||||
done
|
||||
done
|
||||
else
|
||||
format_item_for_files "$item" >> $files_section
|
||||
fi
|
||||
done
|
||||
|
||||
%files -f files_section.txt
|
||||
|
||||
%license LICENSE
|
||||
%doc README.md CHANGELOG.rst
|
||||
|
||||
%if %{with collection_artifact}
|
||||
%files collection-artifact
|
||||
%{_datadir}/ansible/collections/%{collection_namespace}-%{collection_name}-%{version}.tar.gz
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Mon Mar 09 2026 Sergei Petrosian <spetrosi@redhat.com> - 1.7.4-1
|
||||
- Update to latest upstream version 1.7.4
|
||||
- Resolves: RHEL-153381 : Fix the role failing on steps that copy logs to the controller EL9
|
||||
|
||||
* Tue Feb 24 2026 Sergei Petrosian <spetrosi@redhat.com> - 1.7.1-2
|
||||
- Fix spec file to require rhel-system-roles package
|
||||
- Resolves: RHEL-117252 : [RFE] Add ansible-collection-redhat-leapp to RHEL9
|
||||
|
||||
* Mon Feb 23 2026 Sergei Petrosian <spetrosi@redhat.com> - 1.7.1-1
|
||||
- Update to latest upstream version via commit hash
|
||||
- Resolves: RHEL-117252 : [RFE] Add ansible-collection-redhat-leapp to RHEL9
|
||||
|
||||
* Fri Feb 13 2026 Sergei Petrosian <spetrosi@redhat.com> - 1.7.0-1
|
||||
- Replace upstream value of leapp_system_roles_collection with downstream redhat.rhel_system_roles.
|
||||
- Resolves: RHEL-117252 : [RFE] Add ansible-collection-redhat-leapp to RHEL9
|
||||
|
||||
* Fri Dec 5 2025 Sergei Petrosian <spetrosi@redhat.com> - 0.0.1-1
|
||||
- Initialize the package
|
||||
- Resolves: RHEL-117252 : [RFE] Add ansible-collection-redhat-leapp to RHEL9
|
||||
22
ansible-packaging.inc
Normal file
22
ansible-packaging.inc
Normal file
@ -0,0 +1,22 @@
|
||||
# Helper macros originally from macros.ansible by Igor Raits <ignatenkobrain>
|
||||
# This file is for maintaining the compatibility with macros and other
|
||||
# functionality (generators) provided by ansible-packaging on Fedora.
|
||||
# https://src.fedoraproject.org/rpms/ansible-packaging/blob/rawhide/f/macros.ansible
|
||||
|
||||
%define ansible_roles_dir %{_datadir}/ansible/roles
|
||||
%define ansible_collections_dir %{_datadir}/ansible/collections/ansible_collections
|
||||
|
||||
Provides: ansible-collection(%{collection_namespace}.%{collection_name}) = %{collection_version}
|
||||
|
||||
# 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_install() ansible-galaxy collection install -n -p %{buildroot}%{_datadir}/ansible/collections %{collection_namespace}-%{collection_name}-%{version}.tar.gz
|
||||
|
||||
# TODO: Officially deprecate this macro and add the following line to the macro
|
||||
# def after the new approach has gotten more testing and adoption:
|
||||
# %%{warn: %%{ansible_collection_files} is deprecated. Use %%files -f %%{ansible_collection_filelist} instead.}
|
||||
%define ansible_collection_files %{shrink:
|
||||
%{ansible_collections_dir}/%{collection_namespace}/
|
||||
}
|
||||
|
||||
%define ansible_collection_filelist %{__ansible_builddir}/ansible_collection_files
|
||||
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}
|
||||
Loading…
Reference in New Issue
Block a user