Commit 6b274245 authored by Vincent Pelletier's avatar Vincent Pelletier Committed by Julien Muchembled

erp5.balancer: Fix support for no-ipv6 setup.

parent a4f06b9c
...@@ -312,7 +312,7 @@ link-binary = ...@@ -312,7 +312,7 @@ link-binary =
[template-balancer] [template-balancer]
< = download-base < = download-base
filename = instance-balancer.cfg.in filename = instance-balancer.cfg.in
md5sum = 7fff2d3a812614aa5671f8306dfc991e md5sum = 722ce9bfd981aa6a246e595902086b65
[template-haproxy-cfg] [template-haproxy-cfg]
< = download-base < = download-base
......
...@@ -10,7 +10,11 @@ per partition. No more (undefined result), no less (IndexError). ...@@ -10,7 +10,11 @@ per partition. No more (undefined result), no less (IndexError).
# And think of a way to specify which urls goe through varnish, which go # And think of a way to specify which urls goe through varnish, which go
# directly to haproxy. (maybe just passing literal configuration file chunk) # directly to haproxy. (maybe just passing literal configuration file chunk)
{% set ipv4 = (ipv4_set | list)[0] -%} {% set ipv4 = (ipv4_set | list)[0] -%}
{% set ipv6 = (ipv6_set | list)[0] -%} {% set apache_ip_list = [ipv4] -%}
{% if ipv6_set -%}
{% set ipv6 = (ipv6_set | list)[0] -%}
{% do apache_ip_list.append('[' ~ ipv6 ~ ']') -%}
{% endif -%}
{% if use_ipv6 -%} {% if use_ipv6 -%}
[zope-tunnel-base] [zope-tunnel-base]
...@@ -73,7 +77,7 @@ command-line = "{{ parameter_dict['haproxy'] }}/sbin/haproxy" -f "${haproxy-cfg: ...@@ -73,7 +77,7 @@ command-line = "{{ parameter_dict['haproxy'] }}/sbin/haproxy" -f "${haproxy-cfg:
[apache] [apache]
recipe = slapos.cookbook:apache.zope.backend recipe = slapos.cookbook:apache.zope.backend
backend-list = {{ dumps(apache_dict.values()) }} backend-list = {{ dumps(apache_dict.values()) }}
ip = {{ dumps(['[' ~ ipv6 ~ ']', ipv4]) }} ip = {{ dumps(apache_ip_list) }}
wrapper = ${directory:bin}/apache wrapper = ${directory:bin}/apache
scheme = https scheme = https
key-file = ${directory:apache-conf}/apache.key key-file = ${directory:apache-conf}/apache.key
...@@ -95,7 +99,9 @@ ssl-authentication-crl = ${certificate-authority:ca-crl} ...@@ -95,7 +99,9 @@ ssl-authentication-crl = ${certificate-authority:ca-crl}
[publish] [publish]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish.serialised
{% for family_name, (apache_port, _) in apache_dict.items() -%} {% for family_name, (apache_port, _) in apache_dict.items() -%}
{{ family_name ~ '-v6' }} = ${apache:scheme}://[{{ ipv6 }}]:{{ apache_port }} {% if ipv6_set -%}
{{ family_name ~ '-v6' }} = ${apache:scheme}://[{{ ipv6 }}]:{{ apache_port }}
{% endif -%}
{{ family_name }} = ${apache:scheme}://{{ ipv4 }}:{{ apache_port }} {{ family_name }} = ${apache:scheme}://{{ ipv4 }}:{{ apache_port }}
{% endfor -%} {% endfor -%}
......
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