Accepting request 904744 from home:witekbedyk:branches:server:monitoring

- Provide and reload firewalld configuration only for:
  + openSUSE Leap 15.0, 15.1, 15.2
  + SUSE SLE15, SLE15 SP1, SLE15 SP2

OBS-URL: https://build.opensuse.org/request/show/904744
OBS-URL: https://build.opensuse.org/package/show/server:monitoring/golang-github-prometheus-prometheus?expand=0&rev=47
This commit is contained in:
Witek Bedyk 2021-07-08 13:35:59 +00:00 committed by Git OBS Bridge
parent e2e843b7d3
commit c276db8393
3 changed files with 39 additions and 0 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Jul 8 08:08:39 UTC 2021 - Witek Bedyk <witold.bedyk@suse.com>
- Provide and reload firewalld configuration only for:
+ openSUSE Leap 15.0, 15.1, 15.2
+ SUSE SLE15, SLE15 SP1, SLE15 SP2
-------------------------------------------------------------------
Wed May 19 20:32:28 UTC 2021 - Daniel Molkentin <daniel.molkentin@suse.com>
@ -135,6 +142,14 @@ Mon Nov 9 10:49:39 UTC 2020 - Stefano Torresi <stefano.torresi@suse.com>
* use systemd-sysusers to configure the user in a dedicated 'system-user-prometheus' subpackage
* add 'prometheus' package alias
-------------------------------------------------------------------
Mon Aug 31 13:59:02 UTC 2020 - Patrick Seidensal <pseidensal@suse.com>
- Update package with changes from `server:monitoring` bsc#1175478
Left out removal of firewalld related configuration files as SLE-15-SP1's
`firewalld` package does not contain prometheus configuration yet.
-------------------------------------------------------------------
Fri Jul 31 14:50:21 UTC 2020 - Witek Bedyk <witold.bedyk@suse.com>

View File

@ -40,12 +40,16 @@ Source1: vendor.tar.gz
Source2: prometheus.service
Source3: prometheus.yml
Source4: prometheus.sysconfig
Source5: prometheus.firewall.xml
Patch1: 0001-Do-not-force-the-pure-Go-name-resolver.patch
# Lifted from Debian's prometheus package
Patch2: 0002-Default-settings.patch
# PATCH-FEATURE-OPENSUSE 0003-Add-Uyuni-service-discovery.patch jcavalheiro@suse.de
Patch3: 0003-Add-Uyuni-service-discovery.patch
BuildRequires: fdupes
%if 0%{?suse_version} == 1500 && 0%{?sle_version} < 150300
BuildRequires: firewall-macros
%endif
# Adding glibc-devel-static seems to be required for linking if building
# with -buildmode=pie
BuildRequires: glibc-devel-static
@ -94,6 +98,11 @@ cp -fr console_libraries/ consoles/ %{buildroot}%{_datarootdir}/prometheus
install -m 0755 -d %{buildroot}%{_fillupdir}
install -m 0644 %{SOURCE4} %{buildroot}%{_fillupdir}/sysconfig.prometheus
%if 0%{?suse_version} == 1500 && 0%{?sle_version} < 150300
install -m 0755 -d %{buildroot}%{_libdir}/firewalld/services/
install -m 0644 %{SOURCE5} %{buildroot}%{_libdir}/firewalld/services/prometheus.xml
%endif
install -Dd -m 0750 %{buildroot}%{_localstatedir}/lib/prometheus
install -Dd -m 0750 %{buildroot}%{_localstatedir}/lib/prometheus/data
install -Dd -m 0750 %{buildroot}%{_localstatedir}/lib/prometheus/metrics
@ -107,6 +116,9 @@ install -Dd -m 0750 %{buildroot}%{_localstatedir}/lib/prometheus/metrics
%post
%fillup_only -n prometheus
%service_add_post prometheus.service
%if 0%{?suse_version} == 1500 && 0%{?sle_version} < 150300
%firewalld_reload
%endif
%preun
%service_del_preun prometheus.service
@ -133,4 +145,10 @@ install -Dd -m 0750 %{buildroot}%{_localstatedir}/lib/prometheus/metrics
%dir %{_sysconfdir}/prometheus
%config(noreplace) %{_sysconfdir}/prometheus/prometheus.yml
%if 0%{?suse_version} == 1500 && 0%{?sle_version} < 150300
%dir %{_libdir}/firewalld
%dir %{_libdir}/firewalld/services
%{_libdir}/firewalld/services/prometheus.xml
%endif
%changelog

6
prometheus.firewall.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>Prometheus</short>
<description>Prometheus monitoring system and time series database.</description>
<port protocol="tcp" port="9090"/>
</service>