runner/resilient stack: add status history
[slapos.git] / stack / resilient / instance-pull-backup.cfg.in
1 [buildout]
2
3 parts =
4   publish-connection-informations
5   pbs
6   logrotate
7   cron
8   cron-entry-logrotate
9   sshkeys-authority
10   sshkeys-dropbear
11 ## Monitoring part
12 ###Parts to add for monitoring
13   certificate-authority
14   cron-entry-monitor
15   cron-entry-rss
16   deploy-index
17   deploy-settings-cgi
18   deploy-status-cgi
19   deploy-status-history-cgi
20   setup-static-files
21   certificate-authority
22   zero-parameters
23   public-symlink
24   cgi-httpd-wrapper
25   cgi-httpd-graceful-wrapper
26   monitor-promise
27   monitor-instance-log-access
28 ## Monitor for pbs
29   monitor-current-log-access
30   monitor-backup-log-access
31   monitor-check-resilient-feed-file
32
33 extends = ${monitor-template:output}
34 eggs-directory = ${buildout:eggs-directory}
35 develop-eggs-directory = ${buildout:develop-eggs-directory}
36 offline = true
37
38
39 #----------------
40 #--
41 #-- Creation of all needed directories.
42
43 [rootdirectory]
44 recipe = slapos.cookbook:mkdirectory
45 etc = $${buildout:directory}/etc
46 home = $${buildout:directory}/home
47 srv = $${buildout:directory}/srv
48 bin = $${buildout:directory}/bin
49 tmp = $${buildout:directory}/tmp
50 var = $${buildout:directory}/var
51
52 [basedirectory]
53 recipe = slapos.cookbook:mkdirectory
54 log = $${rootdirectory:var}/log
55 services = $${rootdirectory:etc}/service
56 run = $${rootdirectory:var}/run
57 backup = $${rootdirectory:srv}/backup
58 promises = $${rootdirectory:etc}/promise
59 ssh-home = $${rootdirectory:home}/ssh
60 notifier = $${rootdirectory:etc}/notifier
61
62 [directory]
63 recipe = slapos.cookbook:mkdirectory
64 logrotate-entries = $${rootdirectory:etc}/logrotate.d
65 logrotate-backup = $${basedirectory:backup}/logrotate
66 cronstamps = $${rootdirectory:etc}/cronstamps
67 cron-entries = $${rootdirectory:etc}/cron.d
68 crontabs = $${rootdirectory:etc}/crontabs
69 cronoutput = $${basedirectory:log}/cron-ouput
70 pbs-backup = $${basedirectory:backup}/pbs
71 sshkeys = $${rootdirectory:srv}/sshkeys
72 pbs-wrappers = $${rootdirectory:bin}/pbs
73 dot-ssh = $${basedirectory:ssh-home}/.ssh
74 notifier-feeds = $${basedirectory:notifier}/feeds
75 notifier-callbacks = $${basedirectory:notifier}/callbacks
76
77
78
79 #----------------
80 #--
81 #-- Set up the equeue and notifier.
82
83 [equeue]
84 recipe = slapos.cookbook:equeue
85 socket = $${basedirectory:run}/equeue.sock
86 log = $${basedirectory:log}/equeue.log
87 database = $${rootdirectory:srv}/equeue.db
88 wrapper = $${basedirectory:services}/equeue
89 equeue-binary = ${buildout:bin-directory}/equeue
90
91 # notifier.notify adds the [exporter, notifier] to the execution queue
92 # notifier.notify.callback sets up a callback
93 [notifier]
94 recipe = slapos.recipe.template:jinja2
95 template = ${template-wrapper:output}
96 rendered = $${:wrapper}
97 wrapper = $${basedirectory:services}/notifier
98 mode = 0700
99 command = ${buildout:bin-directory}/pubsubserver --callbacks $${directory:notifier-callbacks} --feeds $${directory:notifier-feeds} --equeue-socket $${equeue:socket} --logfile $${basedirectory:log}/notifier.log $${:host} $${:port}
100 host = $${slap-network-information:global-ipv6}
101 port = 8088
102 context =
103   key content notifier:command
104
105
106 [logrotate-entry-equeue]
107 <= logrotate
108 recipe = slapos.cookbook:logrotate.d
109 name = equeue
110 log = $${equeue:log}
111 frequency = daily
112 rotate-num = 30
113
114
115 #----------------
116 #--
117 #-- The pull-backup-server contains every backup (incremental)
118 #-- to prevent a corrupt dump from destroying everything.
119
120 [pbs]
121 <= notifier
122 recipe = slapos.cookbook:pbs
123 client = true
124 feeds = $${directory:notifier-feeds}
125 callbacks = $${directory:notifier-callbacks}
126 equeue-socket = $${equeue:socket}
127 notifier-binary = ${buildout:bin-directory}/pubsubnotifier
128 rdiffbackup-binary = ${buildout:bin-directory}/rdiff-backup
129 sshclient-binary = $${dropbear-client:wrapper}
130 known-hosts = $${directory:dot-ssh}/known_hosts
131 promises-directory = $${basedirectory:promises}
132 directory = $${directory:pbs-backup}
133 cron-entries = $${cron:cron-entries}
134 wrappers-directory = $${directory:pbs-wrappers}
135 run-directory = $${basedirectory:run}
136 # XXX: this should be named "notifier-host"
137 notifier-url = http://[$${notifier:host}]:$${notifier:port}
138 slave-instance-list = $${slap-parameter:slave_instance_list}
139
140
141 #----------------
142 #--
143 #-- Deploy cron.
144
145 [cron]
146 recipe = slapos.cookbook:cron
147 dcrond-binary = ${dcron:location}/sbin/crond
148 cron-entries = $${directory:cron-entries}
149 crontabs = $${directory:crontabs}
150 cronstamps = $${directory:cronstamps}
151 catcher = $${cron-simplelogger:wrapper}
152 binary = $${basedirectory:services}/crond
153
154 [cron-simplelogger]
155 recipe = slapos.cookbook:simplelogger
156 wrapper = $${rootdirectory:bin}/cron_simplelogger
157 log = $${basedirectory:log}/crond.log
158
159
160 #----------------
161 #--
162 #-- Deploy logrotate.
163
164 [cron-entry-logrotate]
165 <= cron
166 recipe = slapos.cookbook:cron.d
167 name = logrotate
168 frequency = 0 0 * * *
169 command = $${logrotate:wrapper}
170
171 [logrotate]
172 recipe = slapos.cookbook:logrotate
173 # Binaries
174 logrotate-binary = ${logrotate:location}/usr/sbin/logrotate
175 gzip-binary = ${gzip:location}/bin/gzip
176 gunzip-binary = ${gzip:location}/bin/gunzip
177 # Directories
178 wrapper = $${rootdirectory:bin}/logrotate
179 conf = $${rootdirectory:etc}/logrotate.conf
180 logrotate-entries = $${directory:logrotate-entries}
181 backup = $${directory:logrotate-backup}
182 state-file = $${rootdirectory:srv}/logrotate.status
183
184 [logrotate-entry-cron]
185 <= logrotate
186 recipe = slapos.cookbook:logrotate.d
187 name = cron
188 log = $${cron-simplelogger:log}
189 frequency = daily
190 rotate-num = 30
191
192
193 #----------------
194 #--
195 #-- sshkeys
196
197 [sshkeys-directory]
198 recipe = slapos.cookbook:mkdirectory
199 requests = $${directory:sshkeys}/requests
200 keys = $${directory:sshkeys}/keys
201
202 [sshkeys-authority]
203 recipe = slapos.cookbook:sshkeys_authority
204 request-directory = $${sshkeys-directory:requests}
205 keys-directory = $${sshkeys-directory:keys}
206 wrapper = $${basedirectory:services}/sshkeys_authority
207 keygen-binary = ${dropbear:location}/bin/dropbearkey
208
209 [sshkeys-dropbear]
210 <= sshkeys-authority
211 recipe = slapos.cookbook:sshkeys_authority.request
212 name = pbs
213 type = rsa
214 executable = $${dropbear-client:wrapper}
215 public-key = $${dropbear-client:identity-file}.pub
216 private-key = $${dropbear-client:identity-file}
217 wrapper = $${rootdirectory:bin}/do_backup
218
219
220 #----------------
221 #--
222 #-- Dropbear.
223
224 [dropbear-client]
225 recipe = slapos.cookbook:dropbear.client
226 dbclient-binary = ${dropbear:location}/bin/dbclient
227 wrapper = $${rootdirectory:bin}/ssh
228 home = $${basedirectory:ssh-home}
229 identity-file = $${basedirectory:ssh-home}/id_rsa
230
231
232 #----------------
233 #--
234 #-- Slave instance list (empty default).
235
236 [slap-parameter]
237 slave_instance_list = []
238
239
240
241 #----------------
242 #--
243 #-- Publish instance parameters.
244
245 [publish-connection-informations]
246 recipe = slapos.cookbook:publish
247 ssh-key = $${sshkeys-dropbear:public-key-value}
248 notification-url = http://[$${notifier:host}]:$${notifier:port}/notify
249 feeds-url = http://[$${notifier:host}]:$${notifier:port}/get/
250
251
252 #----------------
253 #--
254 #-- Monitor
255
256 [monitor-backup-log-access]
257 < = monitor-directory-access
258 source = $${directory:logrotate-backup}
259
260 [monitor-current-log-access]
261 < = monitor-directory-access
262 source = $${basedirectory:log}
263
264 [monitor-check-resilient-feed-file]
265 recipe = slapos.recipe.template:jinja2
266 template = ${template-monitor-check-resilient-feed:location}/${template-monitor-check-resilient-feed:filename}
267 rendered = $${monitor-directory:monitor-custom-scripts}/check-create-resilient-feed-files.py
268 mode = 700
269 context =
270   key input_feed_directory directory:notifier-feeds
271   key monitor_feed_directory monitor-directory:public-cgi
272   key base_url publish-connection-informations:feeds-url
273   raw python_executable ${buildout:executable}