Commit 5dc76934 authored by Łukasz Nowak's avatar Łukasz Nowak

caddy-frontend: Simplify Jinja2 templates

Avoid controlling whitespace as this is not needed, and can result with
erroneous files.
parent 985553a9
...@@ -23,11 +23,11 @@ md5sum = 21f4e3ac43b662e734ce1bd6c98516a6 ...@@ -23,11 +23,11 @@ md5sum = 21f4e3ac43b662e734ce1bd6c98516a6
[template-apache-replicate] [template-apache-replicate]
filename = instance-apache-replicate.cfg.in filename = instance-apache-replicate.cfg.in
md5sum = a30d4bc21ae94d0eca42cea5032468a8 md5sum = d521bf1d2bdc037860eb874beac1ee6d
[template-slave-list] [template-slave-list]
filename = templates/apache-custom-slave-list.cfg.in filename = templates/apache-custom-slave-list.cfg.in
md5sum = ecca3955ba747444f505216839fd1645 md5sum = 7eb42ef6aec24af641deab8f65864189
[template-slave-configuration] [template-slave-configuration]
filename = templates/custom-virtualhost.conf.in filename = templates/custom-virtualhost.conf.in
...@@ -35,7 +35,7 @@ md5sum = 74275ad73b03114c69f80c8f8ae73374 ...@@ -35,7 +35,7 @@ md5sum = 74275ad73b03114c69f80c8f8ae73374
[template-replicate-publish-slave-information] [template-replicate-publish-slave-information]
filename = templates/replicate-publish-slave-information.cfg.in filename = templates/replicate-publish-slave-information.cfg.in
md5sum = 665e83d660c9b779249b2179d7ce4b4e md5sum = 8d318af17da5631d4242c0d6d1531066
[template-caddy-frontend-configuration] [template-caddy-frontend-configuration]
filename = templates/Caddyfile.in filename = templates/Caddyfile.in
...@@ -43,7 +43,7 @@ md5sum = 2c3685356bef4b52fa2e654712e463cd ...@@ -43,7 +43,7 @@ md5sum = 2c3685356bef4b52fa2e654712e463cd
[template-custom-slave-list] [template-custom-slave-list]
filename = templates/apache-custom-slave-list.cfg.in filename = templates/apache-custom-slave-list.cfg.in
md5sum = ecca3955ba747444f505216839fd1645 md5sum = 7eb42ef6aec24af641deab8f65864189
[template-not-found-html] [template-not-found-html]
filename = templates/notfound.html filename = templates/notfound.html
...@@ -51,11 +51,11 @@ md5sum = f20d6c3d2d94fb685f8d26dfca1e822b ...@@ -51,11 +51,11 @@ md5sum = f20d6c3d2d94fb685f8d26dfca1e822b
[template-default-slave-virtualhost] [template-default-slave-virtualhost]
filename = templates/default-virtualhost.conf.in filename = templates/default-virtualhost.conf.in
md5sum = 25222f8a997bb26a6e3dfa2b7c41a103 md5sum = 30792249220b3e4fddd7e50236b455dc
[template-cached-slave-virtualhost] [template-cached-slave-virtualhost]
filename = templates/cached-virtualhost.conf.in filename = templates/cached-virtualhost.conf.in
md5sum = 6e569282b05fa326d0e9aa6958cb6910 md5sum = d5e9851aa54a9d05be7d7312af6ce3de
[template-log-access] [template-log-access]
filename = templates/template-log-access.conf.in filename = templates/template-log-access.conf.in
...@@ -87,11 +87,11 @@ md5sum = eae367cbf665816fbfe274026c848075 ...@@ -87,11 +87,11 @@ md5sum = eae367cbf665816fbfe274026c848075
[template-nginx-eventsource-slave-virtualhost] [template-nginx-eventsource-slave-virtualhost]
filename = templates/nginx-eventsource-slave.conf.in filename = templates/nginx-eventsource-slave.conf.in
md5sum = a0c5c376753da042c5f8444a33066acf md5sum = 69d65e461cd7cd5ef5b1ccd0098b50c8
[template-nginx-notebook-slave-virtualhost] [template-nginx-notebook-slave-virtualhost]
filename = templates/nginx-notebook-slave.conf.in filename = templates/nginx-notebook-slave.conf.in
md5sum = 193184d052d8ef8b09fa980cbca90798 md5sum = 548af159669069102ab9a1aae7b7dc25
[template-apache-lazy-script-call] [template-apache-lazy-script-call]
filename = templates/apache-lazy-script-call.sh.in filename = templates/apache-lazy-script-call.sh.in
......
{% if slap_software_type in software_type -%} {% if slap_software_type in software_type %}
[jinja2-template-base] [jinja2-template-base]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
...@@ -12,33 +12,33 @@ context = ...@@ -12,33 +12,33 @@ context =
key slave_instance_list slap-parameter:slave_instance_list key slave_instance_list slap-parameter:slave_instance_list
${:extra-context} ${:extra-context}
{% set part_list = [] -%} {% set part_list = [] %}
{% set single_type_key = 'single-' %} {% set single_type_key = 'single-' %}
{% if slap_software_type == "replicate" %} {% if slap_software_type == "replicate" %}
{% set frontend_type = slapparameter_dict.pop('-frontend-type', 'single-default') -%} {% set frontend_type = slapparameter_dict.pop('-frontend-type', 'single-default') %}
{% elif slap_software_type in ['default', 'RootSoftwareInstance'] -%} {% elif slap_software_type in ['default', 'RootSoftwareInstance'] %}
{% set frontend_type = "%s%s" % (single_type_key, 'custom-personal') -%} {% set frontend_type = "%s%s" % (single_type_key, 'custom-personal') %}
{% else -%} {% else %}
{% set frontend_type = "%s%s" % (single_type_key, slap_software_type) -%} {% set frontend_type = "%s%s" % (single_type_key, slap_software_type) %}
{% endif -%} {% endif %}
{% set frontend_quantity = slapparameter_dict.pop('-frontend-quantity', '1') | int -%} {% set frontend_quantity = slapparameter_dict.pop('-frontend-quantity', '1') | int %}
{% set slave_list_name = 'extra_slave_instance_list' -%} {% set slave_list_name = 'extra_slave_instance_list' %}
{% set frontend_list = [] %} {% set frontend_list = [] %}
{% set frontend_section_list = [] %} {% set frontend_section_list = [] %}
{% set request_dict = {} %} {% set request_dict = {} %}
{% set namebase = 'caddy-frontend' -%} {% set namebase = 'caddy-frontend' %}
# XXX Dirty hack, not possible to define default value before # XXX Dirty hack, not possible to define default value before
{% set sla_computer_caddy_1_key = '-sla-1-computer_guid' -%} {% set sla_computer_caddy_1_key = '-sla-1-computer_guid' %}
{% if not sla_computer_caddy_1_key in slapparameter_dict -%} {% if not sla_computer_caddy_1_key in slapparameter_dict %}
{% do slapparameter_dict.__setitem__(sla_computer_caddy_1_key, '${slap-connection:computer-id}') -%} {% do slapparameter_dict.__setitem__(sla_computer_caddy_1_key, '${slap-connection:computer-id}') %}
{% endif -%} {% endif %}
# Here we request individually each frontend. # Here we request individually each frontend.
# The presence of sla parameters is checked and added if found # The presence of sla parameters is checked and added if found
{% for i in range(1, frontend_quantity + 1) -%} {% for i in range(1, frontend_quantity + 1) %}
{% set frontend_name = "%s-%s" % (namebase, i) -%} {% set frontend_name = "%s-%s" % (namebase, i) %}
{% set request_section_title = 'request-%s' % frontend_name -%} {% set request_section_title = 'request-%s' % frontend_name %}
{% set sla_key = "-sla-%s-" % i -%} {% set sla_key = "-sla-%s-" % i %}
{% set sla_key_length = sla_key | length %} {% set sla_key_length = sla_key | length %}
{% set sla_dict = {} %} {% set sla_dict = {} %}
{% set config_key = "-frontend-config-%s-" % i %} {% set config_key = "-frontend-config-%s-" % i %}
...@@ -48,13 +48,13 @@ context = ...@@ -48,13 +48,13 @@ context =
{% if key.startswith(sla_key) %} {% if key.startswith(sla_key) %}
{% do sla_dict.__setitem__(key[sla_key_length:], slapparameter_dict.pop(key)) %} {% do sla_dict.__setitem__(key[sla_key_length:], slapparameter_dict.pop(key)) %}
# We check for specific configuration regarding the frontend # We check for specific configuration regarding the frontend
{% elif key.startswith(config_key) -%} {% elif key.startswith(config_key) %}
{% do config_dict.__setitem__(key[config_key_length:], slapparameter_dict.pop(key)) %} {% do config_dict.__setitem__(key[config_key_length:], slapparameter_dict.pop(key)) %}
{% endif -%} {% endif %}
{% endfor -%} {% endfor %}
{% do frontend_list.append(frontend_name) -%} {% do frontend_list.append(frontend_name) %}
{% do frontend_section_list.append(request_section_title) -%} {% do frontend_section_list.append(request_section_title) %}
{% do part_list.append(request_section_title) -%} {% do part_list.append(request_section_title) %}
# Filling request dict for slave # Filling request dict for slave
{% set state_key = "-frontend-%s-state" % i %} {% set state_key = "-frontend-%s-state" % i %}
{% do request_dict.__setitem__(request_section_title, {% do request_dict.__setitem__(request_section_title,
...@@ -64,9 +64,9 @@ context = ...@@ -64,9 +64,9 @@ context =
'sla': sla_dict, 'sla': sla_dict,
'state': slapparameter_dict.pop(state_key, None) 'state': slapparameter_dict.pop(state_key, None)
}) %} }) %}
{% endfor -%} {% endfor %}
{% set authorized_slave_string = slapparameter_dict.pop('-frontend-authorized-slave-string', '') -%} {% set authorized_slave_string = slapparameter_dict.pop('-frontend-authorized-slave-string', '') %}
{% set authorized_slave_list = [] %} {% set authorized_slave_list = [] %}
{% set rejected_slave_list = [] %} {% set rejected_slave_list = [] %}
{% for slave in slave_instance_list %} {% for slave in slave_instance_list %}
...@@ -75,7 +75,7 @@ context = ...@@ -75,7 +75,7 @@ context =
{% else %} {% else %}
{% do rejected_slave_list.append(slave.get('slave_reference')) %} {% do rejected_slave_list.append(slave.get('slave_reference')) %}
{% endif %} {% endif %}
{% endfor -%} {% endfor %}
[replicate] [replicate]
<= slap-connection <= slap-connection
...@@ -106,11 +106,11 @@ state = {{ frontend_request.get('state') }} ...@@ -106,11 +106,11 @@ state = {{ frontend_request.get('state') }}
{% do slave_configuration_dict.__setitem__("frontend-name", frontend_request.get('name')) %} {% do slave_configuration_dict.__setitem__("frontend-name", frontend_request.get('name')) %}
config-_ = {{ json_module.dumps(slave_configuration_dict) }} config-_ = {{ json_module.dumps(slave_configuration_dict) }}
{% if frontend_request.get('sla') %} {% if frontend_request.get('sla') %}
{% for parameter, value in frontend_request.get('sla').iteritems() -%} {% for parameter, value in frontend_request.get('sla').iteritems() %}
sla-{{ parameter }} = {{ value }} sla-{{ parameter }} = {{ value }}
{% endfor -%} {% endfor %}
{% endif -%} {% endif %}
{% endfor -%} {% endfor %}
[publish-information] [publish-information]
...@@ -134,9 +134,9 @@ custom-personal = ${dynamic-publish-slave-information:rendered} ...@@ -134,9 +134,9 @@ custom-personal = ${dynamic-publish-slave-information:rendered}
custom-group = ${dynamic-publish-slave-information:rendered} custom-group = ${dynamic-publish-slave-information:rendered}
[slave-information] [slave-information]
{% for frontend_section in frontend_section_list -%} {% for frontend_section in frontend_section_list %}
{{ frontend_section }} = {{ "${%s:connection-slave-instance-information-list}" % frontend_section }} {{ frontend_section }} = {{ "${%s:connection-slave-instance-information-list}" % frontend_section }}
{% endfor -%} {% endfor %}
[dynamic-publish-slave-information] [dynamic-publish-slave-information]
< = jinja2-template-base < = jinja2-template-base
...@@ -150,7 +150,7 @@ extra-context = ...@@ -150,7 +150,7 @@ extra-context =
monitor-url-list += monitor-url-list +=
{% for frontend in frontend_section_list %} {% for frontend in frontend_section_list %}
{{ ' ${' + frontend + ':connection-monitor-base-url}' }} {{ ' ${' + frontend + ':connection-monitor-base-url}' }}
{% endfor -%} {% endfor %}
[buildout] [buildout]
extends = {{ template_monitor }} extends = {{ template_monitor }}
...@@ -158,9 +158,9 @@ parts = ...@@ -158,9 +158,9 @@ parts =
monitor-base monitor-base
publish-slave-information publish-slave-information
publish-information publish-information
{% for part in part_list -%} {% for part in part_list %}
{{ ' %s' % part }} {{ ' %s' % part }}
{% endfor -%} {% endfor %}
# publish-information # publish-information
eggs-directory = {{ eggs_directory }} eggs-directory = {{ eggs_directory }}
...@@ -181,4 +181,4 @@ cert_file = ${slap-connection:cert-file} ...@@ -181,4 +181,4 @@ cert_file = ${slap-connection:cert-file}
slave_instance_list = slave_instance_list =
-frontend-quantity = 1 -frontend-quantity = 1
-frontend-type = single-default -frontend-type = single-default
{%- endif %} {% endif %}
{% set TRUE_VALUES = ['y', 'yes', '1', 'true'] -%} {% set TRUE_VALUES = ['y', 'yes', '1', 'true'] %}
{% set server_alias_list = slave_parameter.get('server-alias', '').split() %} {% set server_alias_list = slave_parameter.get('server-alias', '').split() %}
{% set ssl_proxy_verify = ('' ~ slave_parameter.get('ssl-proxy-verify', '')).lower() in TRUE_VALUES -%} {% set ssl_proxy_verify = ('' ~ slave_parameter.get('ssl-proxy-verify', '')).lower() in TRUE_VALUES %}
{%- set host_list = [slave_parameter.get('custom_domain')] + server_alias_list -%} {% set host_list = [slave_parameter.get('custom_domain')] + server_alias_list %}
{%- set http_host_list = [] %} {% set http_host_list = [] %}
{%- set https_host_list = [] %} {% set https_host_list = [] %}
{%- for host in host_list %} {% for host in host_list %}
{%- do http_host_list.append('http://%s:%s' % (host, cached_port)) %} {% do http_host_list.append('http://%s:%s' % (host, cached_port)) %}
{%- do https_host_list.append('http://%s:%s' % (host, ssl_cached_port)) %} {% do https_host_list.append('http://%s:%s' % (host, ssl_cached_port)) %}
{%- endfor %} {% endfor %}
# Only accept generic (i.e not Zope) backends on http # Only accept generic (i.e not Zope) backends on http
{{ http_host_list|join(', ') }} { {{ http_host_list|join(', ') }} {
...@@ -19,14 +19,14 @@ ...@@ -19,14 +19,14 @@
transparent transparent
timeout 600s timeout 600s
{%- if ssl_proxy_verify %} {% if ssl_proxy_verify %}
{%- if 'ssl_proxy_ca_crt' in slave_parameter %} {% if 'ssl_proxy_ca_crt' in slave_parameter %}
# TODO-Caddy SSLProxyCACertificateFile {{ slave_parameter.get('path_to_ssl_proxy_ca_crt', '') }} # TODO-Caddy SSLProxyCACertificateFile {{ slave_parameter.get('path_to_ssl_proxy_ca_crt', '') }}
# Requires https://github.com/mholt/caddy/issues/1550 or "just adding your CA to the system's trust store" # Requires https://github.com/mholt/caddy/issues/1550 or "just adding your CA to the system's trust store"
{%- endif %} {% endif %}
{%- else %} {% else %}
insecure_skip_verify insecure_skip_verify
{%- endif %} {% endif %}
} }
} }
...@@ -38,13 +38,13 @@ ...@@ -38,13 +38,13 @@
header_upstream -REMOTE_USER header_upstream -REMOTE_USER
transparent transparent
timeout 600s timeout 600s
{%- if ssl_proxy_verify %} {% if ssl_proxy_verify %}
{%- if 'ssl_proxy_ca_crt' in slave_parameter %} {% if 'ssl_proxy_ca_crt' in slave_parameter %}
# TODO-Caddy SSLProxyCACertificateFile {{ slave_parameter.get('path_to_ssl_proxy_ca_crt', '') }} # TODO-Caddy SSLProxyCACertificateFile {{ slave_parameter.get('path_to_ssl_proxy_ca_crt', '') }}
# Requires https://github.com/mholt/caddy/issues/1550 or "just adding your CA to the system's trust store" # Requires https://github.com/mholt/caddy/issues/1550 or "just adding your CA to the system's trust store"
{%- endif %} {% endif %}
{%- else %} {% else %}
insecure_skip_verify insecure_skip_verify
{%- endif %} {% endif %}
} }
} }
{% set url = slave_parameter.get('url') -%} {% set url = slave_parameter.get('url') %}
{% set https_url = slave_parameter.get('https-url', url) -%} {% set https_url = slave_parameter.get('https-url', url) %}
{% if url.startswith("http://") or url.startswith("https://") -%} {% if url.startswith("http://") or url.startswith("https://") %}
{% set upstream = url.split("/")[2] -%} {% set upstream = url.split("/")[2] %}
{% set https_upstream = https_url.split("/")[2] -%} {% set https_upstream = https_url.split("/")[2] %}
{% set protocol = url.split("/")[0] -%} {% set protocol = url.split("/")[0] %}
{% set https_protocol = https_url.split("/")[0] -%} {% set https_protocol = https_url.split("/")[0] %}
{% set proxy_pass = '%s//%s' % (protocol, slave_parameter.get('slave_reference')) -%} {% set proxy_pass = '%s//%s' % (protocol, slave_parameter.get('slave_reference')) %}
{% set https_proxy_pass = '%s//https_%s' % (protocol, slave_parameter.get('slave_reference')) -%} {% set https_proxy_pass = '%s//https_%s' % (protocol, slave_parameter.get('slave_reference')) %}
{%- set ssl_configuration_list = [('ssl_certificate', 'path_to_ssl_crt'), {% set ssl_configuration_list = [('ssl_certificate', 'path_to_ssl_crt'),
('ssl_certificate_key', 'path_to_ssl_key')] -%} ('ssl_certificate_key', 'path_to_ssl_key')] %}
# TODO-Caddy upstream {{ slave_parameter.get('slave_reference') }} { # TODO-Caddy upstream {{ slave_parameter.get('slave_reference') }} {
...@@ -75,10 +75,10 @@ ...@@ -75,10 +75,10 @@
# TODO-Caddy ssl_prefer_server_ciphers on; # TODO-Caddy ssl_prefer_server_ciphers on;
# TODO-Caddy ssl_session_cache shared:SSL:10m; # TODO-Caddy ssl_session_cache shared:SSL:10m;
{% for key, value in ssl_configuration_list -%} {% for key, value in ssl_configuration_list %}
{% if value in slave_parameter -%} {% if value in slave_parameter %}
# TODO-Caddy {{ ' %s' % key }} {{ slave_parameter.get(value) }}; # TODO-Caddy {{ ' %s' % key }} {{ slave_parameter.get(value) }};
{% endif -%} {% endif %}
{% endfor %} {% endfor %}
# TODO-Caddy location /pub { # TODO-Caddy location /pub {
...@@ -110,4 +110,4 @@ ...@@ -110,4 +110,4 @@
# TODO-Caddy default_type "text/event-stream; charset=utf-8"; # TODO-Caddy default_type "text/event-stream; charset=utf-8";
# TODO-Caddy } # TODO-Caddy }
# TODO-Caddy} # TODO-Caddy}
{% endif -%} {% endif %}
{% set url = slave_parameter.get('url') -%} {% set url = slave_parameter.get('url') %}
{% set https_url = slave_parameter.get('https-url', url) -%} {% set https_url = slave_parameter.get('https-url', url) %}
{% if url.startswith("http://") or url.startswith("https://") -%} {% if url.startswith("http://") or url.startswith("https://") %}
{% set upstream = url.split("/")[2] -%} {% set upstream = url.split("/")[2] %}
{% set https_upstream = https_url.split("/")[2] -%} {% set https_upstream = https_url.split("/")[2] %}
{% set protocol = url.split("/")[0] -%} {% set protocol = url.split("/")[0] %}
{% set https_protocol = https_url.split("/")[0] -%} {% set https_protocol = https_url.split("/")[0] %}
{% set proxy_pass = '%s//%s' % (protocol, slave_parameter.get('slave_reference')) -%} {% set proxy_pass = '%s//%s' % (protocol, slave_parameter.get('slave_reference')) %}
{% set https_proxy_pass = '%s//https_%s' % (protocol, slave_parameter.get('slave_reference')) -%} {% set https_proxy_pass = '%s//https_%s' % (protocol, slave_parameter.get('slave_reference')) %}
{%- set ssl_configuration_list = [('ssl_certificate', 'path_to_ssl_crt'), {% set ssl_configuration_list = [('ssl_certificate', 'path_to_ssl_crt'),
('ssl_certificate_key', 'path_to_ssl_key')] -%} ('ssl_certificate_key', 'path_to_ssl_key')] %}
# TODO-Caddy upstream {{ slave_parameter.get('slave_reference') }} { # TODO-Caddy upstream {{ slave_parameter.get('slave_reference') }} {
...@@ -70,10 +70,10 @@ ...@@ -70,10 +70,10 @@
# TODO-Caddy ssl_prefer_server_ciphers on; # TODO-Caddy ssl_prefer_server_ciphers on;
# TODO-Caddy ssl_session_cache shared:SSL:10m; # TODO-Caddy ssl_session_cache shared:SSL:10m;
{% for key, value in ssl_configuration_list -%} {% for key, value in ssl_configuration_list %}
{% if value in slave_parameter -%} {% if value in slave_parameter %}
# TODO-Caddy {{ ' %s' % key }} {{ slave_parameter.get(value) }}; # TODO-Caddy {{ ' %s' % key }} {{ slave_parameter.get(value) }};
{% endif -%} {% endif %}
{% endfor %} {% endfor %}
# TODO-Caddy location / { # TODO-Caddy location / {
...@@ -101,4 +101,4 @@ ...@@ -101,4 +101,4 @@
# TODO-Caddy proxy_read_timeout 86400; # TODO-Caddy proxy_read_timeout 86400;
# TODO-Caddy } # TODO-Caddy }
# TODO-Caddy } # TODO-Caddy }
{% endif -%} {% endif %}
{% set part_list = [] -%} {% set part_list = [] %}
{% set slave_information_dict = {} -%} {% set slave_information_dict = {} %}
# regroup slave information from all frontends # regroup slave information from all frontends
{%- for frontend, slave_list_raw in slave_information.iteritems() -%} {% for frontend, slave_list_raw in slave_information.iteritems() %}
{% if slave_list_raw %} {% if slave_list_raw %}
{% set slave_list = json_module.loads(slave_list_raw) -%} {% set slave_list = json_module.loads(slave_list_raw) %}
{% else %} {% else %}
{% set slave_list = [] %} {% set slave_list = [] %}
{% endif %} {% endif %}
{% for slave_dict in slave_list -%} {% for slave_dict in slave_list %}
{% set slave_reference = slave_dict.pop('slave-reference') %} {% set slave_reference = slave_dict.pop('slave-reference') %}
{% set log_access_url = slave_dict.pop('log-access', '') %} {% set log_access_url = slave_dict.pop('log-access', '') %}
{% set current_slave_dict = slave_information_dict.get(slave_reference, {}) %} {% set current_slave_dict = slave_information_dict.get(slave_reference, {}) %}
{% do current_slave_dict.update(slave_dict) -%} {% do current_slave_dict.update(slave_dict) %}
{% set log_access_list = current_slave_dict.get('log-access-urls', []) %} {% set log_access_list = current_slave_dict.get('log-access-urls', []) %}
{% do log_access_list.append( frontend + ': ' + log_access_url) %} {% do log_access_list.append( frontend + ': ' + log_access_url) %}
{% do current_slave_dict.__setitem__( {% do current_slave_dict.__setitem__(
...@@ -22,22 +22,22 @@ ...@@ -22,22 +22,22 @@
{% do current_slave_dict.__setitem__( {% do current_slave_dict.__setitem__(
'replication_number', 'replication_number',
current_slave_dict.get('replication_number', 0) + 1 current_slave_dict.get('replication_number', 0) + 1
) -%} ) %}
{% do slave_information_dict.__setitem__(slave_reference, current_slave_dict) -%} {% do slave_information_dict.__setitem__(slave_reference, current_slave_dict) %}
{% endfor -%} {% endfor %}
{% endfor %} {% endfor %}
# Publish information for each slave # Publish information for each slave
{% for slave_reference, slave_information in slave_information_dict.iteritems() %} {% for slave_reference, slave_information in slave_information_dict.iteritems() %}
{% set publish_section_title = 'publish-%s' % slave_reference -%} {% set publish_section_title = 'publish-%s' % slave_reference %}
{% do part_list.append(publish_section_title) -%} {% do part_list.append(publish_section_title) %}
[{{ publish_section_title }}] [{{ publish_section_title }}]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
-slave-reference = {{ slave_reference }} -slave-reference = {{ slave_reference }}
log-access-url = {{ json_module.dumps(slave_information.pop('log-access-urls', 1000)) }} log-access-url = {{ json_module.dumps(slave_information.pop('log-access-urls', 1000)) }}
{% for key, value in slave_information.iteritems() -%} {% for key, value in slave_information.iteritems() %}
{{ key }} = {{ value }} {{ key }} = {{ value }}
{% endfor -%} {% endfor %}
{% endfor %} {% endfor %}
[buildout] [buildout]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment