Commit 10dd90ac authored by Vincent Pelletier's avatar Vincent Pelletier

Move sub-partitions parameter down a nesting level.

Simplifies editing the software release by removing the need to edit
instance-erp5-cluster.cf.in each time.
Applied to kumofs, cloudooo, mariadb and zodb.
Partially applied to frontend, as it is more complex.
Not applied to zope, as it is even more complex - but also topical to this
software release.
Also, change default timezone to UTC, to be neutral.
Also, reformat section extension.
parent d0054de1
...@@ -198,7 +198,7 @@ md5sum = 2b68521ebde309d6453336f1a2e46381 ...@@ -198,7 +198,7 @@ md5sum = 2b68521ebde309d6453336f1a2e46381
[template-kumofs] [template-kumofs]
< = download-base < = download-base
filename = instance-kumofs.cfg.in filename = instance-kumofs.cfg.in
md5sum = 2c403be4e1bc03fe98ee301877347584 md5sum = 0dd51fb85ced7e77d4a8544115f90f8e
[template-cloudooo] [template-cloudooo]
< = download-base < = download-base
...@@ -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 = 41a9ae2790acb79adb33985aec1abb8e md5sum = 1d3449cc950e29c5abecf957af716b6e
[template-zeo] [template-zeo]
< = download-base < = download-base
......
{% if slap_software_type == software_type -%} {% if slap_software_type == software_type -%}
{% set has_frontend = slapparameter_dict.get('frontend-software-url', '') != '' -%} {% set frontend_dict = slapparameter_dict.get('frontend', {}) %}
{% 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') -%}
[request-common] [request-common]
recipe = slapos.cookbook:request.serialised recipe = slapos.cookbook:request.serialised
...@@ -17,50 +18,30 @@ config = ...@@ -17,50 +18,30 @@ 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)) }}
[request-mariadb] {% macro request(name, software_type, config_key, config={}, ret=None) -%}
<=request-common {% do config.update(slapparameter_dict.get(config_key, {})) -%}
name = MariaDB DataBase [request-{{ name }}]
software-type = mariadb < = request-common
sla-computer_guid = {{ slapparameter_dict.get('mariadb-computer-guid', computer_id) }} name = {{ name }}
{% set mariadb_dict = slapparameter_dict.get('mariadb-dict', {}) -%} software-type = {{ software_type }}
{% for option, value in mariadb_dict.items() -%} {% if ret != None -%}
return = {{ ret }}
{% endif -%}
sla-computer_guid = {{ slapparameter_dict.get(computer_guid_key + '-computer-guid', computer_id) }}
extra-config = {{ ' '.join(config) }}
{% for option, value in config.items() -%}
config-{{ option }} = {{ dumps(value) }} config-{{ option }} = {{ dumps(value) }}
{% endfor -%} {% endfor -%}
extra-config = {{ ' '.join(mariadb_dict) }} {% endmacro -%}
[request-cloudooo] {{ request('memcached-persistent', 'kumofs', 'kumofs', {'tcpv4-port': 2000}) }}
<=request-common {{ request('memcached-volatile', 'kumofs', 'memcached', {'tcpv4-port': 2010, 'ram-storage-size': 64}) }}
name = Cloudooo {{ request('cloudooo', 'cloudooo', 'cloudooo', {'tcpv4-port': 2020}) }}
extra-config = {{ request('mariadb', 'mariadb', 'mariadb', {'tcpv4-port': 2099}) }}
font-url-list {{ 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') }}
tcpv4-port
config-font-url-list = {{ dumps(slapparameter_dict.get('font-url-list', [])) }}
tcpv4-port = {{ dumps(slapparameter_dict.get(cloudooo-tcpv4-port, 2020)) }}
software-type = cloudooo
sla-computer_guid = {{ slapparameter_dict.get('cloudooo-computer-guid', computer_id) }}
[request-memcached]
<=request-common
name = KumoFS-ram
software-type = kumofs
sla-computer_guid = {{ slapparameter_dict.get('memcached-computer-guid', computer_id) }}
extra-config =
ram-storage-size
tcpv4-port
config-ram-storage-size = {{ slapparameter_dict.get('memcached-size', 64) ~ 'm' }}
config-tcpv4-port = {{ dumps(slapparameter_dict.get('memcached-tcpv4-port', 2010)) }}
[request-kumofs]
<=request-common
name = KumoFS
software-type = kumofs
sla-computer_guid = {{ slapparameter_dict.get('kumofs-computer-guid', computer_id) }}
extra-config =
tcpv4-port
config-tcpv4-port = {{ dumps(slapparameter_dict.get('kumofs-tcpv4-port', 2000)) }}
[request-zope-base] [request-zope-base]
<=request-common < = request-common
return = return =
zope-address-list zope-address-list
extra-config = extra-config =
...@@ -94,28 +75,10 @@ config-zodb-dict = ${request-zodb:connection-zodb-dict} ...@@ -94,28 +75,10 @@ config-zodb-dict = ${request-zodb:connection-zodb-dict}
config-zodb-storage-type = ${request-zodb:connection-zodb-storage-type} config-zodb-storage-type = ${request-zodb:connection-zodb-storage-type}
config-tidstorage-ip = ${request-zodb:connection-tidstorage-ip} config-tidstorage-ip = ${request-zodb:connection-tidstorage-ip}
config-tidstorage-port = ${request-zodb:connection-tidstorage-port} config-tidstorage-port = ${request-zodb:connection-tidstorage-port}
config-timezone = {{ slapparameter_dict.get('timezone', 'Europe/Paris') }} config-timezone = {{ slapparameter_dict.get('timezone', 'UTC') }}
config-site-id = {{ site_id }} config-site-id = {{ site_id }}
software-type = cluster-zope software-type = cluster-zope
[request-zodb]
< = request-common
name = zodb
return =
zodb-storage-type
zodb-dict
tidstorage-ip
tidstorage-port
extra-config =
zodb-dict
tidstorage-dict
tcpv4-port
config-tcpv4-port = {{ dumps(slapparameter_dict.get('zodb-tcpv4-port', 2100)) }}
config-zodb-dict = {{ dumps(slapparameter_dict.get('zodb-dict', {'root': {}})) }}
config-tidstorage-dict = {{ dumps(slapparameter_dict.get('tidstorage-dict')) }}
software-type = zodb-{{ slapparameter_dict.get('zodb-software-type', 'zeo') }}
sla-computer_guid = {{ slapparameter_dict.get('zodb-computer-guid', computer_id) }}
{% set zope_family_dict = {} -%} {% set zope_family_dict = {} -%}
{% for custom_name, zope_parameter_dict in slapparameter_dict.get('zope-partition-dict', {'1': {}}).items() -%} {% for custom_name, zope_parameter_dict in slapparameter_dict.get('zope-partition-dict', {'1': {}}).items() -%}
{% set base_name = 'zope-' ~ custom_name -%} {% set base_name = 'zope-' ~ custom_name -%}
...@@ -189,16 +152,16 @@ config-ca = {{ dumps(slapparameter_dict.get('ca', {})) }} ...@@ -189,16 +152,16 @@ config-ca = {{ dumps(slapparameter_dict.get('ca', {})) }}
[request-frontend-base] [request-frontend-base]
{% if has_frontend -%} {% if has_frontend -%}
< = request-common < = request-common
software-url = {{ slapparameter_dict['frontend-software-url'] }} software-url = {{ frontend_dict['software-url'] }}
software-type = {{ slapparameter_dict.get('frontend-software-type', 'RootSoftwareInstance') }} software-type = {{ frontend_dict.get('software-type', 'RootSoftwareInstance') }}
sla = instance_guid sla = instance_guid
sla-instance_guid = {{ slapparameter_dict['frontend-instance-guid'] }} sla-instance_guid = {{ frontend_dict['instance-guid'] }}
slave = true slave = true
{% set config_dict = { {% set config_dict = {
'type': 'zope', 'type': 'zope',
} -%} } -%}
{% if slapparameter_dict.get('frontend-domain') -%} {% if frontend_dict.get('domain') -%}
{% do config_dict.__setitem__('custom_domain', slapparameter_dict['frontend-domain']) -%} {% do config_dict.__setitem__('custom_domain', frontend_dict['domain']) -%}
{% endif -%} {% endif -%}
extra-config = url {{ config_dict.keys() | join(' ') }} extra-config = url {{ config_dict.keys() | join(' ') }}
{% for name, value in config_dict.items() -%} {% for name, value in config_dict.items() -%}
......
...@@ -44,8 +44,7 @@ gateway-port = {{ tcpv4_port + 3 }} ...@@ -44,8 +44,7 @@ gateway-port = {{ tcpv4_port + 3 }}
# Paths: Data # Paths: Data
{% set ram_storage_size = slapparameter_dict.get('ram-storage-size') -%} {% set ram_storage_size = slapparameter_dict.get('ram-storage-size') -%}
{% if ram_storage_size -%} {% if ram_storage_size -%}
data-path = *#capsiz=${:storage-size} data-path = *#capsiz={{ ram_storage_size }}m
storage-size = {{ ram_storage_size }}
{% else -%} {% else -%}
data-directory = ${directory:kumofs-data} data-directory = ${directory:kumofs-data}
{% endif -%} {% endif -%}
......
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