forked from redhat-cip/dci-openshift-app-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dci-openshift-app-agent.spec
147 lines (112 loc) · 5.16 KB
/
dci-openshift-app-agent.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
Name: dci-openshift-app-agent
Version: 0.5.0
Release: 1.VERS%{?dist}
Summary: DCI OpenShift App Agent
License: ASL 2.0
URL: https://github.com/redhat-cip/dci-openshift-app-agent
BuildArch: noarch
Source0: dci-openshift-app-agent-%{version}.tar.gz
BuildRequires: systemd
BuildRequires: systemd-units
Requires: sudo
Requires: dci-openshift-agent >= 0.4.0
Requires: dci-ansible
%if 0%{?rhel} && 0%{?rhel} < 8
Requires: python2-dciclient >= 2.3.0
%else
Requires: python3-dciclient >= 2.3.0
%endif
Requires: ansible-role-dci-import-keys
Requires: ansible-role-dci-retrieve-component
Requires: ansible-role-dci-cvp
Requires: ansible-collection-community-kubernetes
Requires(pre): shadow-utils
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%description
DCI OpenShift App Agent
%prep
%setup -qc
%build
%clean
%install
install -p -D -m 644 ansible.cfg %{buildroot}%{_datadir}/dci-openshift-app-agent/ansible.cfg
install -p -D -m 644 dci-openshift-app-agent.yml %{buildroot}%{_datadir}/dci-openshift-app-agent/dci-openshift-app-agent.yml
install -p -D -m 644 requirements.yml %{buildroot}%{_datadir}/dci-openshift-app-agent/requirements.yml
for hook in hooks/*.yml; do
install -p -D -m 644 $hook %{buildroot}%{_sysconfdir}/dci-openshift-app-agent/$hook
done
install -p -D -m 644 dcirc.sh.dist %{buildroot}%{_sysconfdir}/dci-openshift-app-agent/dcirc.sh.dist
install -p -D -m 644 hosts.yml %{buildroot}%{_sysconfdir}/dci-openshift-app-agent/hosts.yml
install -p -D -m 644 settings.yml %{buildroot}%{_sysconfdir}/dci-openshift-app-agent/settings.yml
install -p -D -m 644 sysconfig/dci-openshift-app-agent %{buildroot}%{_sysconfdir}/sysconfig/dci-openshift-app-agent
for play in plays/*.yml; do
install -p -D -m 644 $play %{buildroot}%{_datadir}/dci-openshift-app-agent/$play
done
for script in plays/scripts/*; do
install -p -D -m 755 $script %{buildroot}%{_datadir}/dci-openshift-app-agent/$script
done
install -p -D -m 644 group_vars/all %{buildroot}%{_datadir}/dci-openshift-app-agent/group_vars/all
install -p -D -m 644 systemd/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
install -p -D -m 644 systemd/%{name}.timer %{buildroot}%{_unitdir}/%{name}.timer
install -p -D -m 440 dci-openshift-app-agent.sudo %{buildroot}%{_sysconfdir}/sudoers.d/%{name}
install -p -d -m 755 %{buildroot}/%{_sharedstatedir}/%{name}
find samples -type f -exec install -v -p -D -m 644 "{}" "%{buildroot}%{_sharedstatedir}/dci-openshift-app-agent/{}" \;
find roles/* -type f -exec install -v -p -D -m 644 "{}" "%{buildroot}%{_datadir}/dci-openshift-app-agent/{}" \;
install -v -p -D -m 755 dci-openshift-app-agent-ctl %{buildroot}%{_bindir}/dci-openshift-app-agent-ctl
%pre
getent group dci-openshift-app-agent >/dev/null || groupadd -r dci-openshift-app-agent
getent passwd dci-openshift-app-agent >/dev/null || \
useradd -m -g dci-openshift-app-agent -d %{_sharedstatedir}/dci-openshift-app-agent -s /bin/bash \
-c "DCI Openshift App Agent service" dci-openshift-app-agent
exit 0
%post
%systemd_post %{name}.service
%systemd_preun %{name}.timer
%preun
%systemd_preun %{name}.service
%systemd_preun %{name}.timer
%postun
%systemd_postun %{name}.service
%systemd_postun %{name}.timer
%files
%license LICENSE
%config(noreplace) %{_sysconfdir}/dci-openshift-app-agent/hooks/*.yml
%config(noreplace) %{_sysconfdir}/dci-openshift-app-agent/hosts.yml
%config(noreplace) %{_sysconfdir}/dci-openshift-app-agent/settings.yml
%config(noreplace) %{_sysconfdir}/sysconfig/dci-openshift-app-agent
%{_bindir}/dci-openshift-app-agent-ctl
%{_sysconfdir}/dci-openshift-app-agent/dcirc.sh.dist
%{_datadir}/dci-openshift-app-agent/ansible.cfg
%{_datadir}/dci-openshift-app-agent/dci-openshift-app-agent.yml
%{_datadir}/dci-openshift-app-agent/requirements.yml
%{_datadir}/dci-openshift-app-agent/plays/*.yml
%{_datadir}/dci-openshift-app-agent/plays/scripts/*
%{_datadir}/dci-openshift-app-agent/roles/*
%{_datadir}/dci-openshift-app-agent/group_vars/all
%{_unitdir}/*
%dir %{_sharedstatedir}/dci-openshift-app-agent
%attr(0755, dci-openshift-app-agent, dci-openshift-app-agent) %{_sharedstatedir}/dci-openshift-app-agent
%{_sysconfdir}/sudoers.d/%{name}
%changelog
* Thu Mar 24 2022 Frederic Lepied <[email protected]> 0.5.0-1
- use dci-vault-client
* Wed Mar 9 2022 Frederic Lepied <[email protected]> 0.4.0-1
- add a Requires on dci-openshift-agent >= 0.4.0 to access the common roles
* Fri Jan 28 2022 Tony Garcia <[email protected]> 0.3.2-1
- Add LICENSE file
* Wed Oct 10 2021 Ramon Perez <[email protected]> 0.3.1-1
- Sub-ids support in d-o-a-a user. Including d-o-a-a/plays/scripts/ entry.
* Wed May 5 2021 Frederic Lepied <[email protected]> 0.3.0-1
- add dci-openshift-app-agent-ctl and settings.yml
* Thu Apr 22 2021 Frederic Lepied <[email protected]> 0.2.1-1
- Include all roles
* Mon Jan 11 2021 Tony Garcia <[email protected]> - 0.1.1-1
- Add package and repo info for jobs
* Mon Dec 21 2020 Frederic Lepied <[email protected]> 0.1.0-1
- refactor
* Thu Nov 19 2020 Thomas Vassilian <[email protected]> - 0.0.2
- Add role to dump all logs from pods in a namespace.
* Mon Jun 29 2020 Thomas Vassilian <[email protected]> - 0.0.1
- Initial release.