[buildout]
parts =
  switch-softwaretype

eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true

[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}

[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
output = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
extra-context =
context =
    key ipv6_set slap-configuration:ipv6
    key eggs_directory buildout:eggs-directory
    key develop_eggs_directory buildout:develop-eggs-directory
    key slapparameter_dict slap-configuration:configuration
    ${:extra-context}

[cloudooo-dynamic-template-parameter-dict]
{% for key, value in dynamic_template_cloudooo_instance_parameter_dict.items() -%}
{{   key }} = {{ dumps(value) }}
{% endfor -%}
instance-parameter-dict = {{ dumps(cloudooo_parameter_dict) }}

[cloudooo-dynamic-template]
< = jinja2-template-base
url = {{ template_cloudooo_instance }}
filename = instance-cloudooo.cfg
extensions = jinja2.ext.do
extra-context =
    section parameter_dict cloudooo-dynamic-template-parameter-dict
    key ipv4_set slap-configuration:ipv4
    import itertools itertools

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