[buildout]

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

parts =
  publish-connection-informations
  redis


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


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

[master-passwd]
recipe = slapos.cookbook:generate.password
storage-path = $${rootdirectory:etc}/.passwd
bytes = 4

[redis]
recipe = slapos.cookbook:redis.server
server_bin = ${redis:location}/bin/redis-server
ipv6 = $${slap-network-information:global-ipv6}
port = 6379
use_passwd = $${slap-parameter:use_passwd}
pid_file = $${basedirectory:run}/redis.pid
server_dir = $${rootdirectory:srv}
passwd = $${master-passwd:passwd}
config_file = $${rootdirectory:etc}/redis.conf
log_file = $${basedirectory:log}/redis.log
wrapper = $${basedirectory:services}/redis_server
promise_wrapper = $${basedirectory:promises}/redis

# Send informations to SlapOS Master
[publish-connection-informations]
recipe = slapos.cookbook:publish
redis_ip = $${redis:ipv6}
redis_port = $${redis:port}
redis_passwd = $${redis:passwd}
redis_uses_password = $${redis:use_passwd}
  
[slap-parameter]
use_passwd = false