instance-nbd.cfg.in 2.07 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#############################
#
# Instanciate nbdserver
#
#############################
[buildout]
parts =
  nbd-promise
  onetimeupload-promise
  publish-connection-information

eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true

[rootdirectory]
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc
srv = $${buildout:directory}/srv
log = $${buildout:directory}/log

[basedirectory]
recipe = slapos.cookbook:mkdirectory
services = $${rootdirectory:etc}/run
25
watched-services = $${rootdirectory:etc}/service
26 27 28
promises = $${rootdirectory:etc}/promise

[nbd-instance]
29
recipe = slapos.cookbook:nbdserver
30 31 32 33 34 35 36 37 38 39 40 41 42 43
ip = $${slap-network-information:global-ipv6}
port = 1024
image-path = $${onetimeupload-instance:image-path}
qemu-path = ${kvm:location}/bin/qemu-nbd
shell-path = ${dash:location}/bin/dash
# XXX TODO: Wait for the iso to be uploaded (execute_wait)
path = $${basedirectory:services}/nbdserver

[nbd-promise]
recipe = slapos.cookbook:check_port_listening
path = $${basedirectory:promises}/nbd_promise
hostname = $${nbd-instance:ip}
port = $${nbd-instance:port}

44 45 46 47 48
[gen-passwd]
recipe = slapos.cookbook:generate.password
storage-path = $${rootdirectory:srv}/passwd
bytes = 24

49
[onetimeupload-instance]
50
recipe = slapos.cookbook:onetimeupload
51
ip = $${slap-network-information:global-ipv6}
52
port = 8080
53 54 55 56
image-path = $${rootdirectory:srv}/cdrom.iso
log-path = $${rootdirectory:log}/onetimeupload.log
shell-path = ${dash:location}/bin/dash
onetimeupload-path = ${buildout:bin-directory}/onetimeupload
57
path = $${basedirectory:watched-services}/onetimeupload
58
key = $${gen-passwd:passwd}
59 60 61 62 63 64 65 66 67 68 69 70

[onetimeupload-promise]
recipe = slapos.cookbook:check_port_listening
path = $${basedirectory:promises}/onetimeupload_promise
hostname = $${onetimeupload-instance:ip}
port = $${onetimeupload-instance:port}

[publish-connection-information]
recipe = slapos.cookbook:publish
nbd_url = nbd://[$${nbd-instance:ip}]:$${nbd-instance:port}
upload_url = http://[$${onetimeupload-instance:ip}]:$${onetimeupload-instance:port}/
upload_key = $${onetimeupload-instance:key}