Commit b0a01f54 authored by Antoine Catton's avatar Antoine Catton

Add promises on lxc SR

parent a7edaab5
#!${:bash} -e
${:test-binary} -f ${:file}
#!${:bash} -e
if [ -f ${:file} ]
then
${:test-binary} $(${:cat} ${:file}) = ${:value}
else
exit 1
fi
...@@ -12,6 +12,10 @@ parts = ...@@ -12,6 +12,10 @@ parts =
shellinabox shellinabox
certificate-authority certificate-authority
ca-shellinabox ca-shellinabox
container-promise
shellinabox-promise
rootfs-promise
[rootdirectory] [rootdirectory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
...@@ -23,6 +27,7 @@ bin = $${buildout:directory}/bin ...@@ -23,6 +27,7 @@ bin = $${buildout:directory}/bin
[basedirectory] [basedirectory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
services = $${rootdirectory:etc}/run services = $${rootdirectory:etc}/run
promises = $${rootdirectory:etc}/promise
[directory] [directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
...@@ -45,7 +50,6 @@ certs = $${directory:ca-dir}/certs/ ...@@ -45,7 +50,6 @@ certs = $${directory:ca-dir}/certs/
newcerts = $${directory:ca-dir}/newcerts/ newcerts = $${directory:ca-dir}/newcerts/
crl = $${directory:ca-dir}/crl/ crl = $${directory:ca-dir}/crl/
[rootfs] [rootfs]
recipe = slapos.cookbook:downloader recipe = slapos.cookbook:downloader
url = $${slap-parameter:rootfs} url = $${slap-parameter:rootfs}
...@@ -118,6 +122,33 @@ recipe = slapos.cookbook:publish ...@@ -118,6 +122,33 @@ recipe = slapos.cookbook:publish
url = https://[$${shellinabox:ipv6}]:$${shellinabox:port}/ url = https://[$${shellinabox:ipv6}]:$${shellinabox:port}/
password = $${shellinabox:password} password = $${shellinabox:password}
[template-promise-state]
recipe = slapos.recipe.template
url = ${promise-state:location}/${promise-state:filename}
bash = ${bash:location}/bin/bash
test-binary = ${coreutils:location}/bin/test
cat = ${coreutils:location}/bin/cat
value = started
mode = 700
[container-promise]
<= template-promise-state
output = $${basedirectory:promises}/slapcontainer
file = $${buildout:directory}/.slapcontainer.state
[shellinabox-promise]
<= template-promise-state
output = $${basedirectory:promises}/shellinabox
file = $${buildout:directory}/.shellinabox.state
[rootfs-promise]
recipe = slapos.recipe.template
url = ${promise-exists:location}/${promise-exists:filename}
output = $${basedirectory:promises}/rootfs
bash = ${bash:location}/bin/bash
test-binary = ${coreutils:location}/bin/test
file = $${rootfs:downloaded-file-complete}
mode = 700
[slap-parameter] [slap-parameter]
rootfs-md5sum = rootfs-md5sum =
...@@ -11,6 +11,8 @@ extends = ...@@ -11,6 +11,8 @@ extends =
../../component/tar/buildout.cfg ../../component/tar/buildout.cfg
../../component/shellinabox/buildout.cfg ../../component/shellinabox/buildout.cfg
../../component/pwgen/buildout.cfg ../../component/pwgen/buildout.cfg
../../component/bash/buildout.cfg
../../component/coreutils/buildout.cfg
find-links += find-links +=
http://www.nexedi.org/static/packages/source/slapos-lxc/ http://www.nexedi.org/static/packages/source/slapos-lxc/
...@@ -36,18 +38,31 @@ mode = 0644 ...@@ -36,18 +38,31 @@ mode = 0644
[template-lxc] [template-lxc]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-lxc.cfg url = ${:_profile_base_location_}/instance-lxc.cfg
md5sum = 056912602caa71a2af9fcae97ee6dfb9 md5sum = af5e31fb41e2d31b25f172df45f29fc6
output = ${buildout:directory}/template-lxc.cfg output = ${buildout:directory}/template-lxc.cfg
mode = 0644 mode = 0644
[lxc-conf-in] [download]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:filename} url = ${:_profile_base_location_}/${:filename}
filename = lxc.conf.in
md5sum = b25334fc369e4e0f608bc64f14b0315d
download-only = true download-only = true
mode = 0644 mode = 0644
[lxc-conf-in]
<= download
filename = lxc.conf.in
md5sum = b25334fc369e4e0f608bc64f14b0315d
[promise-state]
<= download
filename = check_state.sh.in
md5sum = 725fb0477f8b8778566ed4b22b25bf27
[promise-exists]
<= download
filename = check_exists.sh.in
md5sum = 60d4f5f73a3d10a3d7d7201aab977d19
[slapos-toolbox] [slapos-toolbox]
recipe = zc.recipe.egg recipe = zc.recipe.egg
scripts = slapcontainer scripts = slapcontainer
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment