software/cloudooo: Switch to generator for port sequence production.
Fixes all cloudooo being given the same port, because of jinja2 variable scoping. Also, move to buildout.hash.cfg for md5sum maintenance ease.
Showing
... | @@ -10,6 +10,7 @@ | ... | @@ -10,6 +10,7 @@ |
{% set next_port = slapparameter_dict.get(instance_parameter_dict['port-parameter-name'], next_port) | int -%} | {% set next_port = slapparameter_dict.get(instance_parameter_dict['port-parameter-name'], next_port) | int -%} | ||
{% endif -%} | {% endif -%} | ||
{% do assert(next_port > 0) -%} | {% do assert(next_port > 0) -%} | ||
{% set next_port = itertools.count(next_port).next -%} | |||
{% set backend_count = instance_parameter_dict['backend-count'] | int -%} | {% set backend_count = instance_parameter_dict['backend-count'] | int -%} | ||
{% if instance_parameter_dict.get('backend-count-parameter-name') -%} | {% if instance_parameter_dict.get('backend-count-parameter-name') -%} | ||
... | @@ -33,9 +34,8 @@ | ... | @@ -33,9 +34,8 @@ |
{% set mimetype_entry_addition = mimetype_entry_addition ~ "\n" ~ slapparameter_dict.get(instance_parameter_dict['mimetype-entry-addition-parameter-name'], '') -%} | {% set mimetype_entry_addition = mimetype_entry_addition ~ "\n" ~ slapparameter_dict.get(instance_parameter_dict['mimetype-entry-addition-parameter-name'], '') -%} | ||
{% endif -%} | {% endif -%} | ||
{% set apache_port = next_port -%} | {% set apache_port = next_port() -%} | ||
{% set haproxy_port = next_port + 1 -%} | {% set haproxy_port = next_port() -%} | ||
{% set next_port = next_port + 2 -%} | |||
{% set apache_ip_list = [ipv4] -%} | {% set apache_ip_list = [ipv4] -%} | ||
{% if ipv6_set -%} | {% if ipv6_set -%} | ||
... | @@ -184,13 +184,12 @@ ooo-uno-path = {{ parameter_dict['libreoffice-bin'] }}/basis-link/program | ... | @@ -184,13 +184,12 @@ ooo-uno-path = {{ parameter_dict['libreoffice-bin'] }}/basis-link/program |
{% set name = 'cloudooo-' ~ index -%} | {% set name = 'cloudooo-' ~ index -%} | ||
[{{ cloudooo(name) }}] | [{{ cloudooo(name) }}] | ||
< = cloudooo-base | < = cloudooo-base | ||
port = {{ next_port }} | port = {{ next_port() }} | ||
openoffice-port = {{ next_port + 1 }} | openoffice-port = {{ next_port() }} | ||
configuration-file = ${directory:etc}/{{ name }}.cfg | configuration-file = ${directory:etc}/{{ name }}.cfg | ||
data-directory = ${directory:srv}/{{ name }} | data-directory = ${directory:srv}/{{ name }} | ||
wrapper = ${directory:services}/{{ name }} | wrapper = ${directory:services}/{{ name }} | ||
{% set next_port = next_port + 2 -%} | |||
|
|||
{% endfor -%} | {% endfor -%} | ||
[haproxy] | [haproxy] | ||
... | ... |