request: drop redundant 'config' & 'sla' options
[slapos.git] / software / unstable / zimbra-kvm / instance-kvm.cfg.in
1 #############################
2 #
3 # Instanciate kvm
4 #
5 #############################
6 [buildout]
7 parts =
8   certificate-authority
9   request-web-frontend
10   kvm-promise
11   tunnel-ipv6-kvm-https
12   tunnel-ipv6-kvm-ssh
13   tunnel-ipv6-kvm-zimbra-admin
14   tunnel-ipv6-kvm-smtp
15   tunnel-ipv6-kvm-smtp-submission
16   websockify-sighandler
17   novnc-promise
18   publish-kvm-connection-information
19
20 eggs-directory = ${buildout:eggs-directory}
21 develop-eggs-directory = ${buildout:develop-eggs-directory}
22 offline = true
23
24 [directory]
25 recipe = slapos.cookbook:mkdirectory
26 etc = $${buildout:directory}/etc
27 bin = $${buildout:directory}/bin
28 srv = $${buildout:directory}/srv
29 var = $${buildout:directory}/var
30 scripts = $${:etc}/run
31 services = $${:etc}/service
32 promises = $${:etc}/promise
33 novnc-conf = $${:etc}/novnc
34 run = $${:var}/run
35 ca-dir = $${:srv}/ssl
36
37 [create-mac]
38 recipe = slapos.cookbook:generate.mac
39 storage-path = $${directory:srv}/mac
40
41 [gen-passwd]
42 recipe = slapos.cookbook:generate.password
43 storage-path = $${directory:srv}/passwd
44 bytes = 4
45
46 [kvm-instance]
47 # XXX-Cedric: change "KVM" recipe to simple "create wrappers". No need for this
48 # Specific code
49 recipe = slapos.cookbook:zimbra.kvm
50 vnc-ip = $${slap-network-information:local-ipv4}
51 vnc-port = 5901
52 boot-disk-path = $${directory:srv}/boot.qcow2
53 data-disk-path = $${directory:srv}/virtual.qcow2
54 data-disk-size = $${slap-parameter:disk-size}
55 data-disk-type = $${slap-parameter:disk-type}
56 socket-path = $${directory:var}/qmp_socket
57 pid-path = $${directory:run}/pid_file
58 smp-count = $${slap-parameter:cpu-count}
59 ram-size = $${slap-parameter:ram-size}
60 disk-type = virtio
61 mac-address = $${create-mac:mac-address}
62 runner-path = $${directory:services}/kvm
63 controller-path = $${directory:scripts}/kvm_controller
64 shell-path = ${dash:location}/bin/dash
65 qemu-path = ${kvm:location}/bin/qemu-system-x86_64
66 qemu-img-path = ${kvm:location}/bin/qemu-img
67 passwd = $${gen-passwd:passwd}
68
69 [kvm-promise]
70 recipe = slapos.cookbook:check_port_listening
71 path = $${directory:promises}/vnc_promise
72 hostname = $${kvm-instance:vnc-ip}
73 port = $${kvm-instance:vnc-port}
74
75
76 # 6tunnel
77 # Refers to http://wiki.zimbra.com/wiki/Ports#External_Access
78 [tunnel-ipv6-kvm-https]
79 recipe = slapos.cookbook:ipv6toipv4
80 ipv6 = $${slap-network-information:global-ipv6}
81 ipv6-port = 443
82 ipv4 = $${slap-network-information:local-ipv4}
83 ipv4-port = 443
84 shell-path = ${dash:location}/bin/dash
85 6tunnel-path = ${6tunnel:location}/bin/6tunnel
86 runner-path = $${directory:services}/6tunnel-https
87
88 [tunnel-ipv6-kvm-zimbra-admin]
89 recipe = slapos.cookbook:ipv6toipv4
90 ipv6 = $${slap-network-information:global-ipv6}
91 ipv6-port = 7071
92 ipv4 = $${slap-network-information:local-ipv4}
93 ipv4-port = 7071
94 shell-path = ${dash:location}/bin/dash
95 6tunnel-path = ${6tunnel:location}/bin/6tunnel
96 runner-path = $${directory:services}/6tunnel-zimbra_admin
97
98 [tunnel-ipv6-kvm-ssh]
99 recipe = slapos.cookbook:ipv6toipv4
100 ipv6 = $${slap-network-information:global-ipv6}
101 ipv6-port = 2222
102 ipv4 = $${slap-network-information:local-ipv4}
103 ipv4-port = 2222
104 shell-path = ${dash:location}/bin/dash
105 6tunnel-path = ${6tunnel:location}/bin/6tunnel
106 runner-path = $${directory:services}/6tunnel-ssh
107
108 [tunnel-ipv6-kvm-smtp]
109 recipe = slapos.cookbook:ipv6toipv4
110 ipv6 = $${slap-network-information:global-ipv6}
111 ipv6-port = 25
112 ipv4 = $${slap-network-information:local-ipv4}
113 ipv4-port = 25
114 shell-path = ${dash:location}/bin/dash
115 6tunnel-path = ${6tunnel:location}/bin/6tunnel
116 runner-path = $${directory:services}/6tunnel-smtp
117
118 [tunnel-ipv6-kvm-smtp-submission]
119 recipe = slapos.cookbook:ipv6toipv4
120 ipv6 = $${slap-network-information:global-ipv6}
121 ipv6-port = 587
122 ipv4 = $${slap-network-information:local-ipv4}
123 ipv4-port = 587
124 shell-path = ${dash:location}/bin/dash
125 6tunnel-path = ${6tunnel:location}/bin/6tunnel
126 runner-path = $${directory:services}/6tunnel-smtp-submission
127
128
129
130
131
132 [novnc-instance]
133 recipe = slapos.cookbook:novnc
134 path = $${ca-novnc:executable}
135 ip = $${slap-network-information:global-ipv6}
136 port = 6080
137 vnc-ip = $${kvm-instance:vnc-ip}
138 vnc-port = $${kvm-instance:vnc-port}
139 novnc-location = ${noVNC:location}
140 websockify-path = ${buildout:directory}/bin/websockify
141 ssl-key-path = $${ca-novnc:key-file}
142 ssl-cert-path = $${ca-novnc:cert-file}
143
144 [websockify-sighandler]
145 recipe = slapos.cookbook:signalwrapper
146 wrapper-path = $${directory:services}/websockify
147 wrapped-path = $${novnc-instance:path}
148
149 [certificate-authority]
150 recipe = slapos.cookbook:certificate_authority
151 openssl-binary = ${openssl:location}/bin/openssl
152 ca-dir = $${directory:ca-dir}
153 requests-directory = $${cadirectory:requests}
154 wrapper = $${directory:services}/certificate_authority
155 ca-private = $${cadirectory:private}
156 ca-certs = $${cadirectory:certs}
157 ca-newcerts = $${cadirectory:newcerts}
158 ca-crl = $${cadirectory:crl}
159
160 [cadirectory]
161 recipe = slapos.cookbook:mkdirectory
162 requests = $${directory:ca-dir}/requests/
163 private = $${directory:ca-dir}/private/
164 certs = $${directory:ca-dir}/certs/
165 newcerts = $${directory:ca-dir}/newcerts/
166 crl = $${directory:ca-dir}/crl/
167
168 [ca-novnc]
169 <= certificate-authority
170 recipe = slapos.cookbook:certificate_authority.request
171 key-file = $${directory:novnc-conf}/novnc.key
172 cert-file = $${directory:novnc-conf}/novnc.crt
173 executable = $${directory:bin}/novnc
174 wrapper = $${directory:bin}/websockify
175
176 [novnc-promise]
177 recipe = slapos.cookbook:check_port_listening
178 path = $${directory:promises}/novnc_promise
179 hostname = $${novnc-instance:ip}
180 port = $${novnc-instance:port}
181
182
183 [kvm-monitor]
184 recipe = slapos.cookbook:generic.slapmonitor
185 db-path = $${directory:srv}/slapmonitor_database
186
187
188 [request-slave-frontend]
189 recipe = slapos.cookbook:requestoptional
190 software-url = $${slap-parameter:frontend-software-url}
191 server-url = $${slap-connection:server-url}
192 key-file = $${slap-connection:key-file}
193 cert-file = $${slap-connection:cert-file}
194 computer-id = $${slap-connection:computer-id}
195 partition-id = $${slap-connection:partition-id}
196 name = VNC Frontend
197 software-type = $${slap-parameter:frontend-software-type}
198 slave = true
199 config-host = $${novnc-instance:ip}
200 config-port = $${novnc-instance:port}
201 return = url resource port domainname
202 sla-instance_guid = $${slap-parameter:frontend-instance-guid}
203
204 [request-web-frontend]
205 <= slap-connection
206 recipe = slapos.cookbook:requestoptional
207 name = Web Frontend
208 # XXX We have hardcoded SR URL here.
209 software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
210 slave = true
211 config-url = https://[$${tunnel-ipv6-kvm-https:ipv6}]:$${tunnel-ipv6-kvm-https:ipv6-port}/
212 return = site_url
213 config-custom_domain = $${slap-parameter:domain}
214
215 [request-smtp-frontend]
216 <= slap-connection
217 recipe = slapos.cookbook:requestoptional
218 name = SMTP Frontend
219 # XXX We have hardcoded SR URL here.
220 #software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/zimbra-kvm:/software/reverse-proxy-nginx/development.cfg
221 software-url = /opt/slapdev/software/reverse-proxy-nginx/development.cfg
222 slave = true
223 config-smtp-upstream-host = $${tunnel-ipv6-kvm-smtp:ipv6}
224 config-smtp-upstream-port = $${tunnel-ipv6-kvm-smtp:port}
225 return = listening-ipv4
226
227 [publish-kvm-connection-information]
228 recipe = slapos.cookbook:publish
229 web-backend-url = https://[$${tunnel-ipv6-kvm-https:ipv6}]:$${tunnel-ipv6-kvm-https:ipv6-port}/
230 web-url = $${request-web-frontend:connection-site_url}
231 vnc-backend-url = https://[$${novnc-instance:ip}]:$${novnc-instance:port}/vnc_auto.html?host=[$${novnc-instance:ip}]&port=$${novnc-instance:port}&encrypt=1
232 vnc-password = $${kvm-instance:passwd}
233 vnc-url = $${request-slave-frontend:connection-url}/vnc_auto.html?host=$${request-slave-frontend:connection-domainname}&port=$${request-slave-frontend:connection-port}&encrypt=1&path=$${request-slave-frontend:connection-resource}
234 ssh = ssh root@$${tunnel-ipv6-kvm-ssh:ipv6} -p $${tunnel-ipv6-kvm-ssh:ipv6-port}
235 smtp-listening-ipv4 = $${request-smtp-frontend:connection-listening-ipv4}
236
237 [slap-parameter]
238 # Default values if not specified
239 frontend-instance-guid =
240 frontend-software-type = frontend
241 frontend-software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.92:/software/kvm/software.cfg
242
243 ram-size = 4096
244 disk-size = 50
245 disk-type = virtio
246
247 cpu-count = 4
248
249 domain =
250