[buildout]

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

# Here, we don't need KVM to run to import data, so we don't
# even extend the kvm instance profile.
extends = 
  {{ pbsready_import_template }}
{% if str(slapparameter_dict.get('enable-monitor', True)).lower() == 'true' -%}
{{ '  ' ~ template_monitor }}

[resilient-publish-connection-parameter]
monitor-base-url = ${publish:monitor-base-url}
monitor-url = ${publish:monitor-url}
monitor-user = ${publish:monitor-user}
monitor-password = ${publish:monitor-password}

[monitor-instance-parameter]
monitor-httpd-port = 8276
monitor-title = {{ slapparameter_dict.get('name', 'Kvm Resilient clone') }}
cors-domains = {{ slapparameter_dict.get('monitor-cors-domains', '') }}
{%   if slapparameter_dict.get('monitor-username', '') -%}
username = {{ slapparameter_dict['monitor-username'] }}
{%   endif -%}
{%   if slapparameter_dict.get('monitor-password', '') -%}
password = {{ slapparameter_dict['monitor-password'] }}
{%   endif -%}
instance-configuration =
  raw takeover-url ${resilient-publish-connection-parameter:takeover-url}
  raw takeover-password ${resilient-publish-connection-parameter:takeover-password}
{% endif -%}

[directory]
recipe = slapos.cookbook:mkdirectory
etc = ${buildout:directory}/etc
bin = ${buildout:directory}/bin
srv = ${buildout:directory}/srv
var = ${buildout:directory}/var
log = ${:var}/log
scripts = ${:etc}/run
services = ${:etc}/service
promises = ${:etc}/promise
novnc-conf = ${:etc}/novnc
run = ${:var}/run
ca-dir = ${:srv}/ssl
cron-entries = ${:etc}/cron.d
crontabs = ${:etc}/crontabs
cronstamps = ${:etc}/cronstamps

[importer]
recipe = slapos.recipe.template:jinja2
template = {{ template_kvm_import }}
rendered = ${directory:bin}/${slap-parameter:namebase}-importer
mode = 0700
# Resilient stack wants a "wrapper" parameter
wrapper = ${:rendered}
context =
    section directory directory
    raw zcat_binary {{ zcat_binary }}
    raw gzip_binary {{ gzip_binary }}

backup-disk-path = ${directory:backup}/virtual.qcow2
