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

3 4 5 6
# Default parameters
# NOTE: in case of resilient instance, auto-deploy-instance
# set to false (else it could be dangerous)
{% do slapparameter_dict.__setitem__('auto-deploy', slapparameter_dict.get('auto-deploy', 'true')) %}
7
{% do slapparameter_dict.__setitem__('auto-deploy-instance', slapparameter_dict.get('auto-deploy-instance', 'true')) %}
8
# let decide the number of clones we want. We can't have more than 2 clones
9
{% set number_of_instances = slapparameter_dict.get('resilient-clone-number', 1)|int %}
10 11
{% if number_of_instances > 2 %}
  {% set number_of_instances = 2 %}
12
{% endif %}
13

14 15 16 17 18 19 20 21 22 23
{% import 'parts' as parts %}
{% import 'replicated' as replicated %}

[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 +=
24
  {{ parts.replicate("runner", number_of_instances + 1) }}
25 26
  publish-connection-informations

27
{{ replicated.replicate("runner", number_of_instances + 1, "runner-export", "runner-import", slapparameter_dict=slapparameter_dict) }}
28 29 30

# Bubble up the parameters
[request-runner]
31
return = url ssh-public-key ssh-url notification-id ip backend_url url ssh_command access_url 1_info 2_info monitor_url monitor_backend_url webdav_url public_url git_public_url git_private_url
32 33 34

[publish-connection-informations]
recipe = slapos.cookbook:publish
35
1_info = ${request-runner:connection-1_info}
36
2_info = ${request-runner:connection-2_info}
37
backend_url = ${request-runner:connection-backend_url}
38
access_url = ${request-runner:connection-access_url}
39 40
url = ${request-runner:connection-url}
ssh_command = ${request-runner:connection-ssh_command}
41
monitor_url = ${request-runner:connection-monitor_url}
42
monitor_backend_url = ${request-runner:connection-monitor_backend_url}
43
webdav_url = ${request-runner:connection-webdav_url}
44
public_url = ${request-runner:connection-public_url}
45 46
git_public_url = ${request-runner:connection-git_public_url}
git_private_url = ${request-runner:connection-git_private_url}
47 48 49 50 51

[slap-parameter]
# Default parameters for distributed deployment
# I.e state "backup1 of maria should go there, ..."
# XXX-Cedric: Hardcoded number of backups. Should be dynamically generated.
52 53 54 55
{% for nb in range(1,number_of_instances+1) %}
runner{{nb}}-computer-guid =
pbs-runner{{nb}}-computer-guid =
{% endfor %}
56 57 58 59
# XXX-Cedric: Hardcoded parameters. Should be dynamically generated.
domain =
authorized-key =
instance-amount = 10
60
debug = false
61
resilient-clone-number = 1