-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrhel-observability-aws-cloudwatch.spec
61 lines (48 loc) · 1.78 KB
/
rhel-observability-aws-cloudwatch.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Name: opentelemetry-collector-cloudwatch-config
Version: 1.0
Release: 2%{?dist}
Summary: Observability cloudwatch integration
BuildArch: noarch
License: Apache-2.0
Source1: config.yaml
Source2: opentelemetry-collector-cloudwatch-config.service
# Necessary to access the systemd macros
BuildRequires: systemd
Requires: opentelemetry-collector
Requires(pre): shadow-utils
Requires(postun): shadow-utils
%description
RHEL observability configuration for AWS cloudwatch integration.
%install
# create expected directory layout
mkdir -p %{buildroot}%{_sysconfdir}/opentelemetry-collector-cloudwatch-config
mkdir -p %{buildroot}%{_unitdir}
# install files
install -p -m 0644 -D %{SOURCE1} %{buildroot}%{_sysconfdir}/opentelemetry-collector-cloudwatch-config/config.yaml
install -p -m 0644 -D %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service
%pre
/usr/bin/getent group aws-observability > /dev/null || /usr/sbin/groupadd -r aws-observability
/usr/bin/getent passwd aws-observability > /dev/null || /usr/sbin/useradd -r -M -s /sbin/nologin -g aws-observability -G systemd-journal aws-observability
%post
/bin/systemctl --system daemon-reload 2>&1
%postun
/usr/sbin/userdel aws-observability
%preun
if [ $1 -eq 0 ]; then
/bin/systemctl --quiet stop %{name}.service
/bin/systemctl --quiet disable %{name}.service
fi
%posttrans
/bin/systemctl is-enabled %{name}.service >/dev/null 2>&1
if [ $? -eq 0 ]; then
/bin/systemctl restart %{name}.service >/dev/null
fi
%files
%{_unitdir}/%{name}.service
%{_sysconfdir}/opentelemetry-collector-cloudwatch-config/config.yaml
%changelog
* Thu Apr 04 2024 Felix Kolwa <[email protected]> - 1.0-2
- fix binary and config path in service file.
- version bump
* Wed Feb 7 2024 Nina Olear <[email protected]> - 1.0-1
- Adding installation routine for config and service file