-
Notifications
You must be signed in to change notification settings - Fork 3
/
dci-openstack-agent.spec
146 lines (123 loc) · 5.59 KB
/
dci-openstack-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
Name: dci-openstack-agent
Version: 0.1.0
Release: 1.VERS%{?dist}
Summary: DCI OpenStack Agent for DCI control server
License: ASL 2.0
URL: https://github.com/redhat-cip/dci-openstack-agent
BuildArch: noarch
Source0: dci-openstack-agent-%{version}.tar.gz
%if 0%{?rhel} && 0%{?rhel} < 8
%global with_python2 1
%else
%global with_python3 1
%endif
%if 0%{?rhel} && 0%{?rhel} < 8
Requires: python2-dciclient >= 2.3.0
%else
Requires: python3-dciclient >= 2.3.0
%endif
BuildRequires: systemd
BuildRequires: systemd-units
BuildRequires: git
BuildRequires: /usr/bin/pathfix.py
%if 0%{?with_python3}
BuildRequires: python3-devel
%else
BuildRequires: python2-devel
%endif
Requires: dci-ansible
Requires: python-netaddr
Requires: ansible-role-dci-retrieve-component >= 0.2.1
Requires: ansible-role-dci-sync-registry
Requires: ansible-role-openstack-certification
Requires: sudo
Requires: python-docker-py
Conflicts: python-docker > 2.0
Conflicts: dci-ansible-agent <= 0.0.201811291905git108553f3-1
Obsoletes: dci-ansible-agent <= 0.0.201811291905git108553f3-1
Requires(pre): shadow-utils
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%description
DCI OpenStack Agent for DCI control server.
%prep
%setup -qc
%if 0%{?with_python3}
pathfix.py -i "%{__python3} %{py3_shbang_opts}" -pn roles/
%else
pathfix.py -i "%{__python2} %{py2_shbang_opts}" -pn roles/
%endif
%build
%install
install -p -D -m 644 systemd/dci-openstack-agent.service %{buildroot}%{_unitdir}/dci-openstack-agent.service
install -p -D -m 644 systemd/dci-openstack-agent.timer %{buildroot}%{_unitdir}/dci-openstack-agent.timer
install -p -D -m 644 systemd/dci-openstack-agent-setup.service %{buildroot}%{_unitdir}/dci-openstack-agent-setup.service
install -p -D -m 644 ansible.cfg %{buildroot}%{_datadir}/dci-openstack-agent/ansible.cfg
cp -r files %{buildroot}/%{_datadir}/dci-openstack-agent
cp -r roles %{buildroot}/%{_datadir}/dci-openstack-agent
cp -r plays %{buildroot}/%{_datadir}/dci-openstack-agent
cp -r group_vars %{buildroot}/%{_datadir}/dci-openstack-agent
install -p -D -m 644 dci-openstack-agent.yml %{buildroot}%{_datadir}/dci-openstack-agent/dci-openstack-agent.yml
install -p -D -m 644 dcirc.sh %{buildroot}%{_sysconfdir}/dci-openstack-agent/dcirc.sh
install -p -D -m 644 hooks/pre-run.yml %{buildroot}%{_sysconfdir}/dci-openstack-agent/hooks/pre-run.yml
install -p -D -m 644 hooks/running.yml %{buildroot}%{_sysconfdir}/dci-openstack-agent/hooks/running.yml
install -p -D -m 644 hooks/teardown.yml %{buildroot}%{_sysconfdir}/dci-openstack-agent/hooks/teardown.yml
install -p -D -m 644 hooks/success.yml %{buildroot}%{_sysconfdir}/dci-openstack-agent/hooks/success.yml
install -p -D -m 644 hooks/local_tests.yml %{buildroot}%{_sysconfdir}/dci-openstack-agent/hooks/local_tests.yml
install -p -D -m 644 hooks/failure.yml %{buildroot}%{_sysconfdir}/dci-openstack-agent/hooks/failure.yml
install -p -D -m 644 settings.yml %{buildroot}%{_sysconfdir}/dci-openstack-agent/settings.yml
install -p -D -m 440 dci-openstack-agent.sudo %{buildroot}%{_sysconfdir}/sudoers.d/dci-openstack-agent
install -p -d -m 755 %{buildroot}/%{_sharedstatedir}/dci-openstack-agent
%clean
%pre
getent group dci-openstack-agent >/dev/null || groupadd -r dci-openstack-agent
getent passwd dci-openstack-agent >/dev/null || \
useradd -r -m -g dci-openstack-agent -d %{_sharedstatedir}/dci-openstack-agent -s /bin/bash \
-c "DCI-OpenStack-Agent service" dci-openstack-agent
exit 0
%post
%systemd_post dci-openstack-agent.service
%systemd_post dci-openstack-agent.timer
%systemd_post dci-openstack-agent-setup.service
%preun
%systemd_preun dci-openstack-agent.service
%systemd_preun dci-openstack-agent.timer
%systemd_preun dci-openstack-agent-setup.service
%postun
%systemd_postun dci-openstack-agent.service
%systemd_postun dci-openstack-agent.timer
%systemd_postun dci-openstack-agent-setup.service
%files
%doc LICENSE README.md
%{_unitdir}/dci-openstack-agent.service
%{_unitdir}/dci-openstack-agent.timer
%{_unitdir}/dci-openstack-agent-setup.service
%{_datadir}/dci-openstack-agent
%config(noreplace) %{_sysconfdir}/dci-openstack-agent/dcirc.sh
%config(noreplace) %{_sysconfdir}/dci-openstack-agent/settings.yml
%config(noreplace) %{_sysconfdir}/dci-openstack-agent/hooks/pre-run.yml
%config(noreplace) %{_sysconfdir}/dci-openstack-agent/hooks/running.yml
%config(noreplace) %{_sysconfdir}/dci-openstack-agent/hooks/success.yml
%config(noreplace) %{_sysconfdir}/dci-openstack-agent/hooks/local_tests.yml
%config(noreplace) %{_sysconfdir}/dci-openstack-agent/hooks/teardown.yml
%config(noreplace) %{_sysconfdir}/dci-openstack-agent/hooks/failure.yml
%dir %{_sharedstatedir}/dci-openstack-agent
%attr(0755, dci-openstack-agent, dci-openstack-agent) %{_sharedstatedir}/dci-openstack-agent
/etc/sudoers.d/dci-openstack-agent
%changelog
* Thu Nov 02 2023 Guillaume Vincent <[email protected]> 0.1.0-1
- Fix rpm name
* Tue Aug 08 2023 Frederic Lepied <[email protected]> 0.0.0-6
- simplify dependencies to be compatible with RHEL9
* Mon Jul 17 2023 François Charlier <[email protected]> 0.0.0-5
- discard ansible-role-dci-import-keys role
- require ansible-role-dci-retrieve-component >= 0.2.1
* Thu Mar 24 2022 Frederic Lepied <[email protected]> 0.0.0-4
- use dci-vault-client
* Mon Jun 22 2020 François Charlier <[email protected]> - 0.0.0-3
- Fix python shebang for el8
* Fri Jan 17 2020 François Charlier <[email protected]> - 0.0.0-2
- Added the "failure.yml" hook
* Tue Mar 28 2017 Gonéri Le Bouder <[email protected]> - 0.0.0-1
- Initial release