forked from mantl/mesos-packaging
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spec.yml
55 lines (45 loc) · 1.54 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
55
---
name: marathon-dynamic
version: 0.15.3
license: ASL 2.0
iteration: 1
vendor: Asteris
url: http://github.com/asteris-llc/mesos-packaging
architecture: noarch
description: dynamic reconfiguration of marathon with Consul
type: rpm
depends:
- consul-template >= 0.10.0
- marathon = {{.Version}}
targets:
- src: '{{.SpecRoot}}/marathon.hcl'
dest: /etc/consul-template/config.d/marathon.hcl
- src: '{{.SpecRoot}}/templates/'
dest: /etc/consul-template/templates/
- src: '{{.SpecRoot}}/consul-template-marathon'
dest: /etc/sudoers.d/
scripts:
after-install: |
# move existing configurations out of the way
for file in marathon; 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-master
sudo -u consul consul-template -config /etc/consul-template/config.d/marathon.hcl -once
systemctl restart marathon.service
systemctl restart consul-template.service
after-upgrade: |
systemctl restart consul-template.service
after-remove: |
systemctl restart consul-template.service
# restore configs and remove rendered versions
for file in marathon; do
rm /etc/sysconfig/${file}
rm /var/run/consul-template/${file}
mv /etc/sysconfig/${file}.pre-dynamic /etc/sysconfig/${file}
done
systemctl restart marathon.service
extra-args:
--rpm-os linux