This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
spec.yml
54 lines (44 loc) · 1.63 KB
/
spec.yml
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
---
name: mesos-agent-dynamic
version: 0.28.2
license: ASL 2.0
iteration: 1
vendor: Asteris
url: http://github.com/asteris-llc/mesos-packaging
architecture: noarch
description: dynamic reconfiguration of mesos-agent with Consul
type: rpm
depends:
- consul-template >= 0.10.0
- mesos-agent = {{.Version}}
targets:
- src: '{{specFile "mesos-agent.hcl"}}'
dest: /etc/consul-template/config.d/mesos-agent.hcl
- src: '{{specFile "templates"}}/'
dest: /etc/consul-template/templates/
- src: '{{specFile "consul-template-mesos-agent"}}'
dest: /etc/sudoers.d/
scripts:
after-install: |
# move existing configurations out of the way
for file in mesos-agent mesos-credential mesos-agent-firewall-rules.json; do
ln -sb --suffix=.pre-dynamic /var/run/consul-template/${file} /etc/sysconfig/${file}
done
# TODO: figure out what other configs here are going to be important and
# include them but not much else, since we don't want to re-render *all* the
# templates, just the ones for mesos-agent
sudo -u consul consul-template -config /etc/consul-template/config.d/mesos-agent.hcl -once
systemctl restart mesos-agent.service
systemctl restart consul-template.service
after-upgrade: |
systemctl restart consul-template.service
after-remove: |
systemctl restart consul-template.service
# restart services which were being templated
for file in mesos-agent mesos-credential mesos-agent-firewall-rules.json; do
rm /etc/sysconfig/${file}
mv /etc/sysconfig/${file}.pre-dynamic /etc/sysconfig/${file}
done
systemctl restart mesos-agent.service
extra-args:
--rpm-os linux