Blame SPECS/ansible-pcp.spec

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