forked from redhat-cip/dci-openstack-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dci-openstack-agent.spec
105 lines (90 loc) · 4.35 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
Name: dci-openstack-agent
Version: 0.0.VERS
Release: 1%{?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
BuildRequires: dci-ansible
BuildRequires: ansible
BuildRequires: systemd
BuildRequires: systemd-units
BuildRequires: git
Requires: dci-ansible
Requires: ansible
Requires: python-netaddr
Requires: ansible-role-dci-import-keys
Requires: ansible-role-dci-retrieve-component
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
%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 templates %{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 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
%files
%doc LICENSE README.md README_advanced.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
%dir %{_sharedstatedir}/dci-openstack-agent
%attr(0755, dci-openstack-agent, dci-openstack-agent) %{_sharedstatedir}/dci-openstack-agent
/etc/sudoers.d/dci-openstack-agent
%changelog
* Tue Mar 28 2017 Gonéri Le Bouder <[email protected]> - 0.0.0-1
- Initial release