[buildout]
parts = switch-softwaretype
eggs-directory = {{ buildout['eggs-directory'] }}
develop-eggs-directory = {{ buildout['develop-eggs-directory'] }}
offline = true

[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
filename = ${:_buildout_section_name_}.cfg
output = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
extensions =
    jinja2.ext.do
extra-context =
context =
    raw buildout_bin_directory {{ buildout['bin-directory'] }}
    raw buildout_parts_directory {{ buildout['parts-directory'] }}
    raw buildout_eggs_directory {{ buildout['eggs-directory'] }}
    raw buildout_develop_eggs_directory {{ buildout['develop-eggs-directory'] }}
    key slapparameter_dict slap-configuration:configuration
    raw instance_default {{ instance_default }}
    raw instance_agent {{ instance_agent }}
    raw openssl_bin {{ openssl_bin }}
    raw telegraf_bin {{ telegraf_bin }}
    raw telegraf_input_slapos_bin {{ telegraf_input_slapos_bin }}
    raw influxd_bin {{ influxd_bin }}
    raw influx_bin {{ influx_bin }}
    raw grafana_bin {{ grafana_bin }}
    raw grafana_homepath {{ grafana_homepath }}
    raw loki_bin {{ loki_bin }}
    raw promtail_bin {{ promtail_bin }}
    raw curl_bin {{ curl_bin }}
    raw dash_bin {{ dash_bin }}
    raw jq_bin {{ jq_bin }}
import-list =
    file caucase context:caucase-jinja2-library


[context]
caucase-jinja2-library = {{ caucase_jinja2_library }}


[instance-default]
<= jinja2-template-base
url = {{ instance_default }}

[instance-agent]
<= jinja2-template-base
url = {{ instance_agent }}

[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype

default = instance-default:output
RootSoftwareInstance = ${:default}
agent = instance-agent:output

[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
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}
