[buildout]
parts =
  switch_softwaretype

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

[switch_softwaretype]
recipe = slapos.cookbook:softwaretype
default = $${instance-base-monitor:rendered}
edgetest = $${instance-base-edgetest:rendered}
edgebot = $${instance-base-edgebot:rendered}

[instance-base-monitor]
recipe = slapos.recipe.template:jinja2
template = ${template-monitor:target}
rendered = $${buildout:directory}/template-base-monitor.cfg
extensions = jinja2.ext.do
context = key develop_eggs_directory buildout:develop-eggs-directory
          key eggs_directory buildout:eggs-directory
          key slapparameter_dict slap-configuration:configuration
          section slap_configuration slap-configuration
          raw buildout_bin ${buildout:bin-directory}
          raw monitor_template_output ${monitor-template:output}
          raw network_benck_cfg_output ${network-bench-cfg:output}
          raw monitor_collect_csv_dump ${monitor-collect-csv-dump:output}
mode = 0644

[instance-base-edgetest]
recipe = slapos.recipe.template:jinja2
template = ${template-monitor-edgetest:target}
rendered = $${buildout:directory}/template-monitor-base-edgetest.cfg
extensions = jinja2.ext.do
context = import json_module json
          key develop_eggs_directory buildout:develop-eggs-directory
          key eggs_directory buildout:eggs-directory
          key slapparameter_dict slap-configuration:configuration
          key slap_software_type slap-configuration:slap-software-type
          section slap_configuration slap-configuration
          raw software_type edgetest
          key instance_base_monitor instance-base-monitor:rendered
          key slave_instance_list slap-configuration:slave-instance-list 
          raw buildout_bin ${buildout:bin-directory}
          raw template_json_edgetest_test ${json-test-template:target}
mode = 0644

[instance-base-edgebot]
recipe = slapos.recipe.template:jinja2
template = ${template-monitor-edgebot:target}
rendered = $${buildout:directory}/template-monitor-edgebot.cfg
extensions = jinja2.ext.do
surykatka-binary = ${surykatka:executable}
template-surykatka-ini = ${template-surykatka-ini:target}

context = import json_module json
          key develop_eggs_directory buildout:develop-eggs-directory
          key eggs_directory buildout:eggs-directory
          section slap_configuration slap-configuration
          key slapparameter_dict slap-configuration:configuration
          key slap_software_type slap-configuration:slap-software-type
          raw software_type edgebot
          key surykatka_binary :surykatka-binary
          key template_surykatka_ini :template-surykatka-ini
          raw buildout_bin ${buildout:bin-directory}
          raw monitor_template_output ${monitor-template:output}
          raw monitor_collect_csv_dump ${monitor-collect-csv-dump:output}
mode = 0644


[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}
# Defaults
configuration.check-status-code = 200
configuration.nameserver =
configuration.check-frontend-ip =
configuration.check-certificate-expiration-days = 15
# use monitor-base-port to have monitor listening on each instance
# on different port and also on different port than other services
# it makes it possible to instantiate it correctly on signle IP, for
# example in case of webrunner
configuration.monitor-base-port = 9700