Commit d9e93ae2 authored by Julien Muchembled's avatar Julien Muchembled

erp5: remove ipv6 hack for ZEO partition

We now use a version of ZEO that support ipv6 natively so this is useless.

Although TIDStorage only supports ipv4, it's easier and better to fix TIDStorage
rather than maintaining such hack in SlapOS.
parent 19c377ab
...@@ -217,7 +217,7 @@ md5sum = e40e2e39f4941c6372f4357e8589a5cf ...@@ -217,7 +217,7 @@ md5sum = e40e2e39f4941c6372f4357e8589a5cf
# XXX: "template.cfg" is hardcoded in instanciation recipe # XXX: "template.cfg" is hardcoded in instanciation recipe
filename = template.cfg filename = template.cfg
template = ${:_profile_base_location_}/instance.cfg.in template = ${:_profile_base_location_}/instance.cfg.in
md5sum = 0933c874f99e6ffb36e390729ddd89a0 md5sum = 79bc92c8d6ad75e78b901e96c8804314
extra-context = extra-context =
key mariadb_link_binary template-mariadb:link-binary key mariadb_link_binary template-mariadb:link-binary
key zope_link_binary template-zope:link-binary key zope_link_binary template-zope:link-binary
...@@ -293,12 +293,12 @@ md5sum = 386f5f15d71636f855f22201d38367e5 ...@@ -293,12 +293,12 @@ md5sum = 386f5f15d71636f855f22201d38367e5
[template-zeo] [template-zeo]
< = download-base < = download-base
filename = instance-zeo.cfg.in filename = instance-zeo.cfg.in
md5sum = 651fa2ec2feb768e339936b7855774ca md5sum = 6bf4c5f7f476d420b2429dd0eca8ec0b
[template-zope] [template-zope]
< = download-base < = download-base
filename = instance-zope.cfg.in filename = instance-zope.cfg.in
md5sum = 7f185192e0536ecacc403cf6b1736d2d md5sum = 5ffaadfb2d465cba53bcbc4287df041e
link-binary = link-binary =
${aspell:location}/bin/aspell ${aspell:location}/bin/aspell
${coreutils:location}/bin/basename ${coreutils:location}/bin/basename
......
{% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%}
{% set next_port = slapparameter_dict['tcpv4-port'] -%} {% set next_port = slapparameter_dict['tcpv4-port'] -%}
{% set part_list = [] -%} {% set part_list = [] -%}
{% set storage_dict = {} -%} {% set storage_dict = {} -%}
...@@ -9,10 +8,6 @@ ...@@ -9,10 +8,6 @@
{% set zodb_backup_path = buildout_directory ~ '/srv/backup/zodb' -%} {% set zodb_backup_path = buildout_directory ~ '/srv/backup/zodb' -%}
{% set default_tidstorage_timestamp_path = buildout_directory ~ '/srv/backup/tidstorage' -%} {% set default_tidstorage_timestamp_path = buildout_directory ~ '/srv/backup/tidstorage' -%}
{% macro section(name) %}{% do part_list.append(name) %}{{ name }}{% endmacro -%} {% macro section(name) %}{% do part_list.append(name) %}{{ name }}{% endmacro -%}
{#
XXX: This template only supports exactly one IPv6 per
partition. No more (undefined result), no less (IndexError).
-#}
{% set ipv4 = (ipv4_set | list)[0] -%} {% set ipv4 = (ipv4_set | list)[0] -%}
{% set tidstorage_ip = ipv4 -%} {% set tidstorage_ip = ipv4 -%}
{% set tidstorage_port = 6001 -%} {% set tidstorage_port = 6001 -%}
...@@ -32,17 +27,6 @@ wrapper-path = ${directory:services}/${:base-name} ...@@ -32,17 +27,6 @@ wrapper-path = ${directory:services}/${:base-name}
binary-path = {{ bin_directory }}/runzeo binary-path = {{ bin_directory }}/runzeo
ip = {{ ipv4 }} ip = {{ ipv4 }}
{% if use_ipv6 -%}
{% set ipv6 = (ipv6_set | list)[0] -%}
[ipv6toipv4-base]
recipe = slapos.cookbook:ipv6toipv4
runner-path = ${directory:services}/${:base-name}
6tunnel-path = {{ parameter_dict['6tunnel'] }}/bin/6tunnel
shell-path = {{ parameter_dict['dash'] }}/bin/dash
ipv4 = {{ ipv4 }}
ipv6 = {{ ipv6 }}
{% endif -%}
{% set backup_directory_list = [] -%} {% set backup_directory_list = [] -%}
{% for export_id, mountpoint_dict in slapparameter_dict['zodb-dict'].items() -%} {% for export_id, mountpoint_dict in slapparameter_dict['zodb-dict'].items() -%}
{% do storage_dict.setdefault( {% do storage_dict.setdefault(
...@@ -101,23 +85,7 @@ hostname = {{ "${" ~ zeo_section_name ~ ":ip}" }} ...@@ -101,23 +85,7 @@ hostname = {{ "${" ~ zeo_section_name ~ ":ip}" }}
port = {{ next_port }} port = {{ next_port }}
path = ${directory:promises}/zeo-{{ storage_family }} path = ${directory:promises}/zeo-{{ storage_family }}
{% if use_ipv6 -%}
{% set address = '[' ~ ipv6 ~ ']:' ~ next_port -%}
{% set tunnel_section_name = zeo_section_name ~ "-tunnel" -%}
[{{ tunnel_section_name }}]
< = ipv6toipv4-base
base-name = zeo-tunnel-{{ storage_family }}
ipv6-port = {{ next_port }}
ipv4-port = {{ next_port }}
[{{ section(tunnel_section_name ~ "-promise") }}]
recipe = slapos.cookbook:check_port_listening
hostname = {{ "${" ~ tunnel_section_name ~ ":ipv6}" }}
port = {{ next_port }}
path = ${directory:promises}/zeo-tunnel-{{ storage_family }}
{% else -%}
{% set address = ipv4 ~ ':' ~ next_port -%} {% set address = ipv4 ~ ':' ~ next_port -%}
{% endif -%}
{% for export in export_list -%} {% for export in export_list -%}
{% do zodb_dict[export[0]][2].__setitem__('server', address) -%} {% do zodb_dict[export[0]][2].__setitem__('server', address) -%}
{% endfor -%} {% endfor -%}
...@@ -147,20 +115,6 @@ hostname = ${tidstorage:ip} ...@@ -147,20 +115,6 @@ hostname = ${tidstorage:ip}
port = ${tidstorage:port} port = ${tidstorage:port}
path = ${directory:promises}/tidstorage path = ${directory:promises}/tidstorage
{% if use_ipv6 -%}
[tidstorage-tunnel]
< = ipv6toipv4-base
base-name = tidstorage-tunnel
ipv4-port = ${tidstorage:port}
ipv6-port = ${tidstorage:port}
[{{ section("promise-tidstorage-tunnel") }}]
recipe = slapos.cookbook:check_port_listening
hostname = ${tidstorage-tunnel:ipv6}
port = ${tidstorage-tunnel:ipv6-port}
path = ${directory:promises}/tidstorage
{% endif -%}
[{{ section("cron-entry-tidstorage-backup") }}] [{{ section("cron-entry-tidstorage-backup") }}]
# TODO: # TODO:
# - configurable full/incremental # - configurable full/incremental
...@@ -194,23 +148,14 @@ post = {{ bin_directory }}/slapos-kill --pidfile ${tidstorage:pidfile-name} -s H ...@@ -194,23 +148,14 @@ post = {{ bin_directory }}/slapos-kill --pidfile ${tidstorage:pidfile-name} -s H
[tidstorage] [tidstorage]
ip = ip =
port = port =
[tidstorage-tunnel]
ipv6 =
ipv6-port =
{% endif -%} {% endif -%}
[publish] [publish]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish.serialised
zodb-storage-type = zeoclient zodb-storage-type = zeoclient
zodb-dict = {{ dumps(zodb_dict) }} zodb-dict = {{ dumps(zodb_dict) }}
{% if use_ipv6 -%}
tidstorage-ip = ${tidstorage-tunnel:ipv6}
tidstorage-port = ${tidstorage-tunnel:ipv6-port}
{% else -%}
tidstorage-ip = ${tidstorage:ip} tidstorage-ip = ${tidstorage:ip}
tidstorage-port = ${tidstorage:port} tidstorage-port = ${tidstorage:port}
{% endif -%}
[directory] [directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
......
...@@ -100,49 +100,6 @@ wrapper = ${directory:services}/ca ...@@ -100,49 +100,6 @@ wrapper = ${directory:services}/ca
{% if use_ipv6 -%} {% if use_ipv6 -%}
{% set ipv6 = (ipv6_set | list)[0] -%} {% set ipv6 = (ipv6_set | list)[0] -%}
[zeo-tunnel-base]
recipe = slapos.cookbook:ipv4toipv6
runner-path = ${directory:services}/${:base-name}
6tunnel-path = {{ parameter_dict['6tunnel'] }}/bin/6tunnel
shell-path = {{ parameter_dict['dash'] }}/bin/dash
ipv4 = {{ ipv4 }}
{% if storage_type == 'zeoclient' -%}
{# ZEO needs tunelling for IPv6 (...until next version becomes current in Zope) -#}
{% set zeo_tunneling_dict = {} -%}
{% for _, _, storage_dict in zodb_dict.values() -%}
{% set storage_server = storage_dict['server'] -%}
{% if storage_server not in zeo_tunneling_dict -%}
{% set current_port = next_port + (zeo_tunneling_dict | length) -%}
{% do zeo_tunneling_dict.__setitem__(storage_server, current_port) -%}
[{{ section('zeo-tunnel-' ~ current_port) }}]
< = zeo-tunnel-base
base-name = {{ 'zeo-tunnel-' ~ current_port }}
ipv4-port = {{ current_port }}
ipv6-port = {{ storage_server.split(']:')[1] }}
ipv6 = {{ storage_server.split(']:')[0][1:] }}
{% endif -%}
{% do storage_dict.__setitem__('server', '' ~ ipv4 ~ ':' ~ zeo_tunneling_dict[storage_server]) -%}
{% endfor -%}
{% set next_port = next_port + (zeo_tunneling_dict | length) -%}
{% endif -%}
{% if slapparameter_dict.get('tidstorage-ip') -%}
[tidstorage-tunnel]
< = zeo-tunnel-base
base-name = tidstorage-tunnel
ipv4-port = {{ next_port }}
ipv6 = {{ dumps(slapparameter_dict.get('tidstorage-ip')) }}
ipv6-port = {{ dumps(slapparameter_dict.get('tidstorage-port')) }}
{% do slapparameter_dict.__setitem__('tidstorage-ip', ipv4) -%}
{% do slapparameter_dict.__setitem__('tidstorage-port', next_port) -%}
{% set next_port = next_port + 1 -%}
[{{ section("promise-tidstorage-tunnel") }}]
recipe = slapos.cookbook:check_port_listening
hostname = ${tidstorage-tunnel:ipv4}
port = ${tidstorage-tunnel:ipv4-port}
path = ${directory:promises}/tidstorage
{% endif -%}
[ipv6toipv4-base] [ipv6toipv4-base]
recipe = slapos.cookbook:ipv6toipv4 recipe = slapos.cookbook:ipv6toipv4
......
...@@ -92,8 +92,6 @@ extra-context = ...@@ -92,8 +92,6 @@ extra-context =
[dynamic-template-zeo-parameters] [dynamic-template-zeo-parameters]
buildout-bin-directory = {{ buildout_bin_directory }} buildout-bin-directory = {{ buildout_bin_directory }}
6tunnel = {{ sixtunnel_location }}
dash = {{ dash_location }}
findutils-location = {{ findutils_location }} findutils-location = {{ findutils_location }}
[dynamic-template-zeo] [dynamic-template-zeo]
......
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