[buildout]

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

parts =
    slapcontainer
    rootfs
    slapcontainer-promise

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

[basedirectory]
recipe = slapos.cookbook:mkdirectory
services = $${rootdirectory:etc}/run
promises = $${rootdirectory:etc}/promise

[slapcontainer]
recipe = slapos.cookbook:slapcontainer
interface = $${slap-network-information:network-interface}
config = $${buildout:directory}/.slapcontainer
lxc-config = $${rootdirectory:etc}/lxc.conf
image = $${rootfs:downloaded-image}
image-complete = $${rootfs:downloaded-image-complete}
tmp-dir = $${rootdirectory:tmp}/slapcontainer/

[slapcontainer-promise]
recipe = slapos.cookbook:slapcontainer.promise
promise = $${basedirectory:promises}/slapcontainer
lxc-info = ${lxc:location}/bin/lxc-info
slapcontainer-name = $${slapcontainer:slapcontainer-name}

[rootfs]
recipe = slapos.cookbook:rootfs
image-url = $${slap-parameter:rootfs}
downloaded-image = $${rootdirectory:srv}/rootfs.img
downloaded-image-complete = $${:downloaded-image}.complete
binary = $${basedirectory:services}/rootfsdownload
wget-binary = ${wget:location}/bin/wget