[buildout]
parts =
  switch-softwaretype

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

[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = tsn-client-dynamic-template:output
tsn-server = tsn-server-dynamic-template:output
RootSoftwareInstance = $${:default}

[dynamic-template-base]
recipe = slapos.recipe.template:jinja2
output = $${buildout:directory}/$${:filename}
context =
    raw chrt ${util-linux:location}/bin/chrt
    key slapparameter_dict slap-configuration:configuration
    key ipv4 slap-configuration:ipv4-random

[tsn-client-dynamic-template]
<= dynamic-template-base
extensions = jinja2.ext.do
url = ${template-tsn-client:output}
filename = instance-tsn-client.cfg

[tsn-server-dynamic-template]
<= dynamic-template-base
url = ${template-tsn-server:output}
filename = instance-tsn-server.cfg

[slap-configuration]
recipe = slapos.cookbook:slapconfiguration
computer = $${slap-connection:computer-id}
partition = $${slap-connection:partition-id}
url = $${slap-connection:server-url}
key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file}
