Resilience: add pidfiles in PBS.
[slapos.git] / stack / resilient / instance-pull-backup.cfg.in
1 [buildout]
2
3 parts =
4   connection-dict
5   pbs
6   logrotate
7   cron
8   cron-entry-logrotate
9   sshkeys-authority
10   sshkeys-dropbear
11
12 eggs-directory = ${buildout:eggs-directory}
13 develop-eggs-directory = ${buildout:develop-eggs-directory}
14 offline = true
15
16
17 #----------------
18 #--
19 #-- Creation of all needed directories.
20
21 [rootdirectory]
22 recipe = slapos.cookbook:mkdirectory
23 etc = $${buildout:directory}/etc
24 home = $${buildout:directory}/home
25 srv = $${buildout:directory}/srv
26 bin = $${buildout:directory}/bin
27 tmp = $${buildout:directory}/tmp
28 var = $${buildout:directory}/var
29
30 [basedirectory]
31 recipe = slapos.cookbook:mkdirectory
32 log = $${rootdirectory:var}/log
33 services = $${rootdirectory:etc}/service
34 run = $${rootdirectory:var}/run
35 backup = $${rootdirectory:srv}/backup
36 promises = $${rootdirectory:etc}/promise
37 ssh-home = $${rootdirectory:home}/ssh
38 notifier = $${rootdirectory:etc}/notifier
39
40 [directory]
41 recipe = slapos.cookbook:mkdirectory
42 logrotate-entries = $${rootdirectory:etc}/logrotate.d
43 logrotate-backup = $${basedirectory:backup}/logrotate
44 cronstamps = $${rootdirectory:etc}/cronstamps
45 cron-entries = $${rootdirectory:etc}/cron.d
46 crontabs = $${rootdirectory:etc}/crontabs
47 cronoutput = $${basedirectory:log}/cron-ouput
48 pbs-backup = $${basedirectory:backup}/pbs
49 sshkeys = $${rootdirectory:srv}/sshkeys
50 pbs-wrappers = $${rootdirectory:bin}/pbs
51 dot-ssh = $${basedirectory:ssh-home}/.ssh
52 notifier-feeds = $${basedirectory:notifier}/feeds
53 notifier-callbacks = $${basedirectory:notifier}/callbacks
54
55
56
57 #----------------
58 #--
59 #-- Set up the equeue and notifier.
60
61 [equeue]
62 recipe = slapos.cookbook:equeue
63 socket = $${basedirectory:run}/equeue.sock
64 log = $${basedirectory:log}/equeue.log
65 database = $${rootdirectory:srv}/equeue.db
66 wrapper = $${basedirectory:services}/equeue
67 equeue-binary = ${buildout:bin-directory}/equeue
68
69 # notifier.notify adds the [exporter, notifier] to the execution queue
70 # notifier.notify.callback sets up a callback
71 [notifier]
72 recipe = slapos.cookbook:notifier
73 feeds = $${directory:notifier-feeds}
74 callbacks = $${directory:notifier-callbacks}
75 id-file = $${rootdirectory:etc}/notifier.id
76 equeue-socket = $${equeue:socket}
77 host = $${slap-network-information:global-ipv6}
78 port = 8088
79 wrapper = $${basedirectory:services}/notifier
80 server-binary = ${buildout:bin-directory}/pubsubserver
81 notifier-binary = ${buildout:bin-directory}/pubsubnotifier
82
83 [logrotate-entry-equeue]
84 <= logrotate
85 recipe = slapos.cookbook:logrotate.d
86 name = equeue
87 log = $${equeue:log}
88 frequency = daily
89 rotate-num = 30
90
91
92 #----------------
93 #--
94 #-- The pull-backup-server contains every backup (incremental)
95 #-- to prevent a corrupt dump from destroying everything.
96
97 [pbs]
98 <= notifier
99 recipe = slapos.cookbook:pbs
100 client = true
101 rdiffbackup-binary = ${buildout:bin-directory}/rdiff-backup
102 sshclient-binary = $${dropbear-client:wrapper}
103 known-hosts = $${directory:dot-ssh}/known_hosts
104 promises-directory = $${basedirectory:promises}
105 directory = $${directory:pbs-backup}
106 cron-entries = $${cron:cron-entries}
107 wrappers-directory = $${directory:pbs-wrappers}
108 run-directory = $${basedirectory:run}
109 # XXX: this should be named "notifier-host"
110 notifier-url = http://[$${notifier:host}]:$${notifier:port}
111 slave-instance-list = $${slap-parameter:slave_instance_list}
112
113
114 #----------------
115 #--
116 #-- Deploy cron.
117
118 [cron]
119 recipe = slapos.cookbook:cron
120 dcrond-binary = ${dcron:location}/sbin/crond
121 cron-entries = $${directory:cron-entries}
122 crontabs = $${directory:crontabs}
123 cronstamps = $${directory:cronstamps}
124 catcher = $${cron-simplelogger:wrapper}
125 binary = $${basedirectory:services}/crond
126
127 [cron-simplelogger]
128 recipe = slapos.cookbook:simplelogger
129 wrapper = $${rootdirectory:bin}/cron_simplelogger
130 log = $${basedirectory:log}/crond.log
131
132
133 #----------------
134 #--
135 #-- Deploy logrotate.
136
137 [cron-entry-logrotate]
138 <= cron
139 recipe = slapos.cookbook:cron.d
140 name = logrotate
141 frequency = 0 0 * * *
142 command = $${logrotate:wrapper}
143
144 [logrotate]
145 recipe = slapos.cookbook:logrotate
146 # Binaries
147 logrotate-binary = ${logrotate:location}/usr/sbin/logrotate
148 gzip-binary = ${gzip:location}/bin/gzip
149 gunzip-binary = ${gzip:location}/bin/gunzip
150 # Directories
151 wrapper = $${rootdirectory:bin}/logrotate
152 conf = $${rootdirectory:etc}/logrotate.conf
153 logrotate-entries = $${directory:logrotate-entries}
154 backup = $${directory:logrotate-backup}
155 state-file = $${rootdirectory:srv}/logrotate.status
156
157 [logrotate-entry-cron]
158 <= logrotate
159 recipe = slapos.cookbook:logrotate.d
160 name = cron
161 log = $${cron-simplelogger:log}
162 frequency = daily
163 rotate-num = 30
164
165
166 #----------------
167 #--
168 #-- sshkeys
169
170 [sshkeys-directory]
171 recipe = slapos.cookbook:mkdirectory
172 requests = $${directory:sshkeys}/requests
173 keys = $${directory:sshkeys}/keys
174
175 [sshkeys-authority]
176 recipe = slapos.cookbook:sshkeys_authority
177 request-directory = $${sshkeys-directory:requests}
178 keys-directory = $${sshkeys-directory:keys}
179 wrapper = $${basedirectory:services}/sshkeys_authority
180 keygen-binary = ${dropbear:location}/bin/dropbearkey
181
182 [sshkeys-dropbear]
183 <= sshkeys-authority
184 recipe = slapos.cookbook:sshkeys_authority.request
185 name = pbs
186 type = rsa
187 executable = $${dropbear-client:wrapper}
188 public-key = $${dropbear-client:identity-file}.pub
189 private-key = $${dropbear-client:identity-file}
190 wrapper = $${rootdirectory:bin}/do_backup
191
192
193 #----------------
194 #--
195 #-- Dropbear.
196
197 [dropbear-client]
198 recipe = slapos.cookbook:dropbear.client
199 dbclient-binary = ${dropbear:location}/bin/dbclient
200 wrapper = $${rootdirectory:bin}/ssh
201 home = $${basedirectory:ssh-home}
202 identity-file = $${basedirectory:ssh-home}/id_rsa
203
204
205 #----------------
206 #--
207 #-- Slave instance list (empty default).
208
209 [slap-parameter]
210 slave_instance_list = []
211
212
213
214 #----------------
215 #--
216 #-- Publish instance parameters.
217
218 [connection-dict]
219 recipe = slapos.cookbook:publish
220 ssh-key = $${sshkeys-dropbear:public-key-value}
221 notification-url = http://[$${notifier:host}]:$${notifier:port}/notify
222 feeds-url = http://[$${notifier:host}]:$${notifier:port}/get/
223