instance-kvm-resilient.cfg.jinja2 1.24 KB
Newer Older
1 2 3
# vim: set ft=cfg:

{% import 'parts' as parts %}
4
{% import 'replicated' as replicated with context %}
5 6 7 8 9 10 11 12

[buildout]
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true

# += because we need to take up parts (like instance-custom, slapmonitor etc) from the profile we extended
parts +=
13
  {{ parts.replicate("kvm", "3") }}
14
  publish-connection-informations
15
  kvm-frontend-url-promise
16

17
{{ replicated.replicate("kvm", "3", "kvm-export", "kvm-import", slapparameter_dict=slapparameter_dict) }}
18

19
# Bubble down the parameters of the requested instance to the user
20
[request-kvm]
21
# Note: += doesn't work.
22 23 24 25
return =
# Resilient related parameters
  url ssh-public-key ssh-url notification-id ip
# KVM related parameters
26
  backend-url url ipv6
27 28 29 30 31

[publish-connection-informations]
recipe = slapos.cookbook:publish
backend-url = ${request-kvm:connection-backend-url}
url = ${request-kvm:connection-url}
32
ipv6 = ${request-kvm:connection-ipv6}
33 34 35 36 37 38 39 40 41 42 43

[kvm-frontend-url-promise]
# Check that url parameter is complete
recipe = collective.recipe.template
input = inline:#!/bin/sh
  URL="${request-kvm:connection-url}"
  if [[ ! "$URL" == https://* ]]; then
    exit 1
  fi
output = ${resilient-directory:promise}/kvm-frontend-url
mode = 700