{% set monitor = True  -%}

{% if slapparameter_dict.get('enable-monitor', 'True').lower() == 'false' -%}
{%   set monitor = False  -%}
{% endif -%}

[buildout]
extends =
  {{ kvm_template }}
  {{ pbsready_export_template }}

parts +=
  cron-entry-backup

  certificate-authority
  publish-connection-information
  kvm-vnc-promise
  kvm-disk-image-corruption-promise
  websockify-sighandler
  novnc-promise
  cron
  frontend-promise
{% if monitor -%}
# monitor parts
  monitor-base
{% endif %}

# Create the exporter executable, which is a simple shell script
[exporter]
recipe = slapos.recipe.template:jinja2
template = {{ template_kvm_export }}
rendered = ${directory:bin}/${slap-parameter:namebase}-exporter
# Resilient stack wants a "wrapper" parameter
wrapper = ${:rendered}
mode = 0700
context =
    section directory directory
    section buildout buildout
    key socket_path kvm-instance:socket-path
    raw gzip_binary {{ gzip_binary }}

# Extends publish section with resilient parameters
[publish-connection-information]
<= resilient-publish-connection-parameter

