Blame SPECS/ansible-pcp.spec

61ce45
Name:             ansible-pcp
11e814
Version:          2.2.7
abad11
Release:          1%{?dist}
61ce45
Summary:          Ansible Metric collection for Performance Co-Pilot
61ce45
License:          MIT
61ce45
URL:              https://github.com/performancecopilot/ansible-pcp
61ce45
Source:           https://github.com/performancecopilot/ansible-pcp/archive/v%{version}/%{name}-%{version}.tar.gz
61ce45
BuildArch:        noarch
61ce45
e08b61
%if 0%{?rhel}
e08b61
%global collection_namespace redhat
e08b61
%global collection_name rhel_metrics
e08b61
%else
e08b61
%global collection_namespace performancecopilot
e08b61
%global collection_name metrics
e08b61
%endif
e08b61
61ce45
# NOTE: Even though ansible-core is in 8.6, it is only available
61ce45
# at *runtime*, not at *buildtime* - so we can't have
abad11
# ansible-core as a build_dep on latest RHEL versions.
abad11
%if 0%{?fedora}
abad11
%bcond_without ansible
61ce45
%global ansible_build_dep ansible-core >= 2.11.0
61ce45
%else
61ce45
%if 0%{?rhel} && ! 0%{?epel}
abad11
%bcond_with ansible
61ce45
%else
abad11
%bcond_without ansible
61ce45
%global ansible_build_dep ansible >= 2.9.10
61ce45
%endif
61ce45
%endif
e08b61
abad11
%if 0%{?rhel} >= 8
abad11
Requires: (ansible-core >= 2.11.0 or ansible >= 2.9.0)
abad11
%endif
abad11
abad11
%if %{with ansible}
61ce45
BuildRequires:    %{ansible_build_dep}
61ce45
%endif
abad11
abad11
%{!?ansible_collection_files:%define ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/}
abad11
abad11
# package has been removed from RHEL8
abad11
%if 0%{?rhel} >= 8
abad11
%bcond_with ansible_lint
61ce45
%else
abad11
%bcond_without ansible_lint
61ce45
%endif
61ce45
abad11
%if %{with ansible_lint}
e08b61
BuildRequires:    python3-ansible-lint
e08b61
%endif
e08b61
e08b61
%description
e08b61
A collection containing roles for Performance Co-Pilot (PCP) and related
e08b61
software such as Redis and Grafana.  The collection is made up of several
e08b61
Ansible roles, including:
e08b61
e08b61
%{collection_namespace}.%{collection_name}.pcp
e08b61
A role for core PCP capabilities, configuring live performance analysis
e08b61
with a large base set of metrics from the kernel and system services, as
e08b61
well as data recording and rule inference.
e08b61
e08b61
%{collection_namespace}.%{collection_name}.redis
e08b61
A role for configuring a local Redis server, suitable for use with a
e08b61
Performance Co-Pilot archive repository (for single or many hosts) and
e08b61
fast, scalable querying of metrics.
e08b61
e08b61
%{collection_namespace}.%{collection_name}.grafana
e08b61
A role for configuring a local Grafana server, providing web frontend
e08b61
visuals for Performance Co-Pilot metrics, both live and historically.
e08b61
Data sources for Vector (live), Redis (historical) and interactive
e08b61
bpftrace (eBPF) scripts can be configured by this role.  The PCP REST
e08b61
API service (from the core pcp role) should be configured in order to
e08b61
use this role.
e08b61
e08b61
%{collection_namespace}.%{collection_name}.bpftrace
e08b61
A role that extends the core PCP role, providing metrics from bpftrace
e08b61
scripts using Linux eBPF facilities.  Configuring authentication of a
e08b61
local user capable of running bpftrace scripts via the PCP agent is a
e08b61
key task of this role.
e08b61
e08b61
%{collection_namespace}.%{collection_name}.elasticsearch
e08b61
A role that extends the core PCP role, providing metrics from a live
e08b61
ElasticSearch instance for PCP analysis or exporting of PCP metric
e08b61
values (and metadata) to ElasticSearch for the indexing and querying
e08b61
of performance data.
e08b61
e08b61
%prep
e08b61
%autosetup
e08b61
mv .yamllint.yml yamllint.yml
e08b61
mv .yamllint_defaults.yml yamllint_defaults.yml
e08b61
%if 0%{?rhel}
e08b61
rm -vr roles/repository tests/*repository* tests/*/*repository* docs/repository
e08b61
%endif
e08b61
rm -vr .github .gitignore .ansible-lint .*.yml
e08b61
sed -i \
e08b61
    -e 's/^name: .*/name: %{collection_name}/g' \
e08b61
    -e 's/^namespace: .*/namespace: %{collection_namespace}/g' \
e08b61
    galaxy.yml
e08b61
find . -name \*.yml -o -name \*.md | while read file; do
e08b61
    sed -i \
e08b61
        -e 's/performancecopilot.metrics/%{collection_namespace}.%{collection_name}/g' \
e08b61
    $file
e08b61
done
e08b61
e08b61
%build
abad11
%if %{with ansible}
e08b61
%ansible_collection_build
61ce45
%else
61ce45
tar -cf %{_tmppath}/%{collection_namespace}-%{collection_name}-%{version}.tar.gz .
61ce45
%endif
e08b61
e08b61
%install
abad11
%if %{with ansible}
e08b61
%ansible_collection_install
61ce45
%else
61ce45
mkdir -p %{buildroot}%{ansible_collection_files}/%{collection_name}
61ce45
cd %{buildroot}%{ansible_collection_files}/%{collection_name}
61ce45
tar -xf %{_tmppath}/%{collection_namespace}-%{collection_name}-%{version}.tar.gz
61ce45
%endif
e08b61
e08b61
%check
e08b61
mv yamllint.yml .yamllint.yml
e08b61
mv yamllint_defaults.yml .yamllint_defaults.yml
abad11
%if %{with ansible_lint}
e08b61
ansible-lint `find roles -name \*.yml`
e08b61
%endif
e08b61
e08b61
%files
e08b61
%doc README.md
e08b61
%license LICENSE
e08b61
%{ansible_collection_files}
e08b61
e08b61
%changelog
11e814
* Fri Oct 28 2022 Nathan Scott <nathans@redhat.com> 2.2.7-1
11e814
- Latest upstream release (BZ 2132847)
11e814
abad11
* Thu Apr 21 2022 Nathan Scott <nathans@redhat.com> 2.2.5-1
abad11
- Switch to using bcond spec file mechanisms
abad11
- Latest upstream release (BZ 2059464)
abad11
61ce45
* Tue Feb 15 2022 Nathan Scott <nathans@redhat.com> 2.2.2-2
61ce45
- RHEL8.6+, RHEL9+, Fedora - add "ansible-core or ansible" dep
61ce45
78ff60
* Fri Nov 12 2021 Nathan Scott <nathans@redhat.com> 2.2.2-1
78ff60
- Resolves Grafana provisioning issue (BZ 1967321)
61ce45
- Latest upstream release (BZ 2022168)
78ff60
61ce45
* Thu Aug 26 2021 Nathan Scott <nathans@redhat.com> 2.2.1-1
e08b61
- Latest upstream release
e08b61
e08b61
* Fri Jun 25 2021 Nathan Scott <nathans@redhat.com> 2.1.4-1
e08b61
- Latest upstream release
e08b61
61ce45
* Tue Jun 08 2021 Nathan Scott <nathans@redhat.com> 2.1.3-3
61ce45
- Rebuild for full pass through CI/gating processes
61ce45
61ce45
* Mon Jun 07 2021 Nathan Scott <nathans@redhat.com> 2.1.3-2
61ce45
- Drop unnecessary package dependency on Ansible
61ce45
61ce45
* Thu Jun 03 2021 Nathan Scott <nathans@redhat.com> 2.1.3-1
61ce45
- Initial version of RHEL package (BZ 1854055)
e08b61
- Latest upstream release
e08b61
e08b61
* Fri Feb 05 2021 Nathan Scott <nathans@redhat.com> 2.1.2-1
e08b61
- Add RHEL macros to the spec alongside Fedora
e08b61
- Latest upstream release
e08b61
e08b61
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.3-2
e08b61
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
e08b61
e08b61
* Wed Nov 11 2020 Nathan Scott <nathans@redhat.com> 2.0.3-1
e08b61
- Updated for new version with changed namespace
e08b61
- Ansible collection macros now used in the spec
e08b61
- Added ansible-lint checking in %%check section
e08b61
e08b61
* Fri Oct 23 2020 Nathan Scott <nathans@redhat.com> 1.0.0-1
e08b61
- Initial RPM spec build