Commit 7c4ceb0a authored by Jérome Perrin's avatar Jérome Perrin

erp5/balancer: add entries for direct access to zopes

parent e75f3152
......@@ -86,7 +86,7 @@ md5sum = d1257e7e942307be0a79e34aa4320e9f
[template-balancer]
filename = instance-balancer.cfg.in
md5sum = f0fd49c7d6d9f7c6936afba0d18b7691
md5sum = 384d6f167836e98944860fb62158c4c7
[template-haproxy-cfg]
filename = haproxy.cfg.in
......
......@@ -99,6 +99,7 @@ ipv4 = {{ ipv4 }}
{% set apache_dict = {} -%}
{% set zope_virtualhost_monster_backend_dict = {} %}
{% set test_runner_url_dict = {} %} {# family_name => list of apache URLs #}
{% set direct_zope_url_dict = {} %} {# family_name => list of apache URLs #}
{% set next_port = itertools.count(slapparameter_dict['tcpv4-port']).next -%}
{% for family_name, parameter_id_list in sorted(
slapparameter_dict['zope-family-dict'].iteritems()) -%}
......@@ -163,6 +164,18 @@ ipv6 = {{ zope_address.split(']:')[0][1:] }}
{% set external_scheme = 'https' -%}
{% endif -%}
{% do apache_dict.__setitem__(family_name, (next_port(), external_scheme, internal_scheme ~ '://' ~ ipv4 ~ ':' ~ haproxy_port ~ backend_path, ssl_authentication)) -%}
{# Direct access to backend zopes. #}
{% set external_port = next_port() %}
{% set direct_zope_url_list = [] %}
{% set direct_zope_backend_mapping = {} %}
{% for i, (zope_family_address, _, _) in enumerate(zope_family_address_list) %}
{% do direct_zope_url_list.append('https://[' ~ ipv6 ~ ']:' ~ external_port ~ '/' ~ family_name ~ '/zope-' ~ i ) %}
{% do direct_zope_backend_mapping.__setitem__(family_name ~ '/zope-' ~ i, 'http://' ~ zope_family_address ) %}
{% endfor -%}
{% do zope_virtualhost_monster_backend_dict.__setitem__(('[' ~ ipv6 ~ ']', external_port), (ssl_authentication, direct_zope_backend_mapping) ) -%}
{% do direct_zope_url_dict.__setitem__(family_name, direct_zope_url_list) %}
{% endfor -%}
[haproxy-cfg-parameter-dict]
......@@ -250,6 +263,10 @@ recipe = slapos.cookbook:publish.serialised
{% for family_name, test_runner_url_list in test_runner_url_dict.items() -%}
{{ family_name ~ '-test-runner-url-list' }} = {{ dumps(test_runner_url_list) }}
{% endfor -%}
{% for family_name, direct_zope_url_list in direct_zope_url_dict.items() -%}
{{ family_name ~ '-direct-zope-url-list' }} = {{ dumps(direct_zope_url_list) }}
{% endfor -%}
monitor-base-url = ${monitor-publish-parameters:monitor-base-url}
......
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