Resilient stack: notifier-url is rather a notifier-host
[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 = 8080
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 # XXX: this should be named "notifier-host"
109 notifier-url = http://[$${notifier:host}]:$${notifier:port}
110 slave-instance-list = $${slap-parameter:slave_instance_list}
111
112
113 #----------------
114 #--
115 #-- Deploy cron.
116
117 [cron]
118 recipe = slapos.cookbook:cron
119 dcrond-binary = ${dcron:location}/sbin/crond
120 cron-entries = $${directory:cron-entries}
121 crontabs = $${directory:crontabs}
122 cronstamps = $${directory:cronstamps}
123 catcher = $${cron-simplelogger:wrapper}
124 binary = $${basedirectory:services}/crond
125
126 [cron-simplelogger]
127 recipe = slapos.cookbook:simplelogger
128 wrapper = $${rootdirectory:bin}/cron_simplelogger
129 log = $${basedirectory:log}/crond.log
130
131
132 #----------------
133 #--
134 #-- Deploy logrotate.
135
136 [cron-entry-logrotate]
137 <= cron
138 recipe = slapos.cookbook:cron.d
139 name = logrotate
140 frequency = 0 0 * * *
141 command = $${logrotate:wrapper}
142
143 [logrotate]
144 recipe = slapos.cookbook:logrotate
145 # Binaries
146 logrotate-binary = ${logrotate:location}/usr/sbin/logrotate
147 gzip-binary = ${gzip:location}/bin/gzip
148 gunzip-binary = ${gzip:location}/bin/gunzip
149 # Directories
150 wrapper = $${rootdirectory:bin}/logrotate
151 conf = $${rootdirectory:etc}/logrotate.conf
152 logrotate-entries = $${directory:logrotate-entries}
153 backup = $${directory:logrotate-backup}
154 state-file = $${rootdirectory:srv}/logrotate.status
155
156 [logrotate-entry-cron]
157 <= logrotate
158 recipe = slapos.cookbook:logrotate.d
159 name = cron
160 log = $${cron-simplelogger:log}
161 frequency = daily
162 rotate-num = 30
163
164
165 #----------------
166 #--
167 #-- sshkeys
168
169 [sshkeys-directory]
170 recipe = slapos.cookbook:mkdirectory
171 requests = $${directory:sshkeys}/requests
172 keys = $${directory:sshkeys}/keys
173
174 [sshkeys-authority]
175 recipe = slapos.cookbook:sshkeys_authority
176 request-directory = $${sshkeys-directory:requests}
177 keys-directory = $${sshkeys-directory:keys}
178 wrapper = $${basedirectory:services}/sshkeys_authority
179 keygen-binary = ${dropbear:location}/bin/dropbearkey
180
181 [sshkeys-dropbear]
182 <= sshkeys-authority
183 recipe = slapos.cookbook:sshkeys_authority.request
184 name = pbs
185 type = rsa
186 executable = $${dropbear-client:wrapper}
187 public-key = $${dropbear-client:identity-file}.pub
188 private-key = $${dropbear-client:identity-file}
189 wrapper = $${rootdirectory:bin}/do_backup
190
191
192 #----------------
193 #--
194 #-- Dropbear.
195
196 [dropbear-client]
197 recipe = slapos.cookbook:dropbear.client
198 dbclient-binary = ${dropbear:location}/bin/dbclient
199 wrapper = $${rootdirectory:bin}/ssh
200 home = $${basedirectory:ssh-home}
201 identity-file = $${basedirectory:ssh-home}/id_rsa
202
203
204 #----------------
205 #--
206 #-- Slave instance list (empty default).
207
208 [slap-parameter]
209 slave_instance_list = []
210
211
212
213 #----------------
214 #--
215 #-- Publish instance parameters.
216
217 [connection-dict]
218 recipe = slapos.cookbook:publish
219 ssh-key = $${sshkeys-dropbear:public-key-value}
220 notification-url = http://[$${notifier:host}]:$${notifier:port}/notify
221 feeds-url = http://[$${notifier:host}]:$${notifier:port}/get/
222