[buildout]

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

parts =
    rootfs
    uuid
    lxc-conf

[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

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

[lxc-conf]
recipe = slapos.cookbook:template
template = ${lxc-conf-in:location}/${lxc-conf-in:filename}
output = $${rootdirectory:etc}/lxc.conf
bridge = $${slap-connection:bridge-name}
interface = lxc$${slap-network-information:network-interface}
name = $${uuid:uuid}
rootfs = $${rootfs:downloaded-file}
requested = $${slap-connection:requested}

[uuid]
recipe = slapos.cookbook:uuid
cache-file = $${buildout:directory}/.slapcontainername

[slap-parameter]
rootfs-md5sum =