Commit 627d01e1 authored by Vincent Pelletier's avatar Vincent Pelletier

Publish sub-partition's published values.

parent 10dd90ac
...@@ -298,7 +298,7 @@ md5sum = 77ec4f095a22b5bd7dfea9dff63bade5 ...@@ -298,7 +298,7 @@ md5sum = 77ec4f095a22b5bd7dfea9dff63bade5
[template-erp5-cluster] [template-erp5-cluster]
< = download-base < = download-base
filename = instance-erp5-cluster.cfg.in filename = instance-erp5-cluster.cfg.in
md5sum = 1d3449cc950e29c5abecf957af716b6e md5sum = f271a904e7cc0039ce109f592fb48b5f
[template-zeo] [template-zeo]
< = download-base < = download-base
......
{% if slap_software_type == software_type -%} {% if slap_software_type == software_type -%}
{% set publish_dict = {} -%}
{% set frontend_dict = slapparameter_dict.get('frontend', {}) %} {% set frontend_dict = slapparameter_dict.get('frontend', {}) %}
{% set has_frontend = frontend_dict.get('software-url', '') != '' -%} {% set has_frontend = frontend_dict.get('software-url', '') != '' -%}
{% set site_id = slapparameter_dict.get('site-id', 'erp5') -%} {% set site_id = slapparameter_dict.get('site-id', 'erp5') -%}
...@@ -6,7 +7,6 @@ ...@@ -6,7 +7,6 @@
recipe = slapos.cookbook:request.serialised recipe = slapos.cookbook:request.serialised
software-url = ${slap-connection:software-release-url} software-url = ${slap-connection:software-release-url}
sla = computer_guid sla = computer_guid
return = url
server-url = ${slap-connection:server-url} server-url = ${slap-connection:server-url}
key-file = ${slap-connection:key-file} key-file = ${slap-connection:key-file}
cert-file = ${slap-connection:cert-file} cert-file = ${slap-connection:cert-file}
...@@ -18,15 +18,19 @@ config = ...@@ -18,15 +18,19 @@ config =
extra-config = extra-config =
config-use-ipv6 = {{ dumps(slapparameter_dict.get('use-ipv6', False)) }} config-use-ipv6 = {{ dumps(slapparameter_dict.get('use-ipv6', False)) }}
{% macro request(name, software_type, config_key, config={}, ret=None) -%} {% macro request(name, software_type, config_key, config={}, ret={'ret': True}) -%}
{% do config.update(slapparameter_dict.get(config_key, {})) -%} {% do config.update(slapparameter_dict.get(config_key, {})) -%}
[request-{{ name }}] {% set section = 'request-' ~ name -%}
[{{ section }}]
< = request-common < = request-common
name = {{ name }} name = {{ name }}
software-type = {{ software_type }} software-type = {{ software_type }}
{% if ret != None -%} return = {{ ret.keys() | join(' ') }}
return = {{ ret }} {% for ret, publish in ret.items() -%}
{% endif -%} {% if publish -%}
{% do publish_dict.__setitem__(name ~ '-' ~ ret, '${' ~ section ~ ':connection-' ~ ret ~ '}')%}
{% endif -%}
{% endfor -%}
sla-computer_guid = {{ slapparameter_dict.get(computer_guid_key + '-computer-guid', computer_id) }} sla-computer_guid = {{ slapparameter_dict.get(computer_guid_key + '-computer-guid', computer_id) }}
extra-config = {{ ' '.join(config) }} extra-config = {{ ' '.join(config) }}
{% for option, value in config.items() -%} {% for option, value in config.items() -%}
...@@ -38,7 +42,7 @@ config-{{ option }} = {{ dumps(value) }} ...@@ -38,7 +42,7 @@ config-{{ option }} = {{ dumps(value) }}
{{ request('memcached-volatile', 'kumofs', 'memcached', {'tcpv4-port': 2010, 'ram-storage-size': 64}) }} {{ request('memcached-volatile', 'kumofs', 'memcached', {'tcpv4-port': 2010, 'ram-storage-size': 64}) }}
{{ request('cloudooo', 'cloudooo', 'cloudooo', {'tcpv4-port': 2020}) }} {{ request('cloudooo', 'cloudooo', 'cloudooo', {'tcpv4-port': 2020}) }}
{{ request('mariadb', 'mariadb', 'mariadb', {'tcpv4-port': 2099}) }} {{ request('mariadb', 'mariadb', 'mariadb', {'tcpv4-port': 2099}) }}
{{ request('zodb', slapparameter_dict.get('zodb-software-type', 'zeo'), 'zodb', {'tcpv4-port': 2100, 'zodb-dict': {'root': {}}}, 'zodb-storage-type zodb-dict tidstorage-ip tidstorage-port') }} {{ request('zodb', slapparameter_dict.get('zodb-software-type', 'zeo'), 'zodb', {'tcpv4-port': 2100, 'zodb-dict': {'root': {}}}, {'zodb-storage-type': False, 'zodb-dict': False, 'tidstorage-ip': False, 'tidstorage-port': False}) }}
[request-zope-base] [request-zope-base]
< = request-common < = request-common
...@@ -99,7 +103,6 @@ sla-computer_guid = {{ zope_parameter_dict.get('computer-guid', computer_id) }} ...@@ -99,7 +103,6 @@ sla-computer_guid = {{ zope_parameter_dict.get('computer-guid', computer_id) }}
{# We need to concatenate lists that we cannot read as lists, so this gets hairy. -#} {# We need to concatenate lists that we cannot read as lists, so this gets hairy. -#}
{% set zope_address_list_id_dict = {} -%} {% set zope_address_list_id_dict = {} -%}
{% set zope_family_parameter_dict = {} -%} {% set zope_family_parameter_dict = {} -%}
{% set publish_dict = {} -%}
{% for family_name, zope_section_id_list in zope_family_dict.items() -%} {% for family_name, zope_section_id_list in zope_family_dict.items() -%}
{% for zope_section_id in zope_section_id_list -%} {% for zope_section_id in zope_section_id_list -%}
{% set parameter_name = 'zope-family-entry-' ~ zope_section_id -%} {% set parameter_name = 'zope-family-entry-' ~ zope_section_id -%}
...@@ -116,7 +119,7 @@ config-url = {{ backend_url }} ...@@ -116,7 +119,7 @@ config-url = {{ backend_url }}
{% else -%} {% else -%}
{% set publishable = 'request-balancer:connection-' ~ family_name -%} {% set publishable = 'request-balancer:connection-' ~ family_name -%}
{% endif -%} {% endif -%}
{% do publish_dict.__setitem__(family_name, publishable) -%} {% do publish_dict.__setitem__('family-' ~ family_name, '${' ~ publishable ~ '}' ) -%}
{% endfor -%} {% endfor -%}
[request-balancer] [request-balancer]
...@@ -172,8 +175,8 @@ return = site_url ...@@ -172,8 +175,8 @@ return = site_url
[publish] [publish]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish.serialised
{% for family_name, publishable in publish_dict.items() -%} {% for name, value in publish_dict.items() -%}
{{ family_name }} = {{ '${' ~ publishable ~ '}' }} {{ name }} = {{ value }}
{% 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