Commit 34ddc357 authored by Vincent Pelletier's avatar Vincent Pelletier

Revert work on erp5 cluster deployment

This work has nothing to do in erp5-component branch, and is preventing it
from being merged to erp5 banch more often.
Conflicts because of non-reverted
6d1a9805 have been resolved to that its
intent is preserved with non-cluster ERP5 SR.

This reverts commit 77976a14.
This reverts commit 7aa1d92c.
This reverts commit 80062015.
This reverts commit 36ed58f2.
This reverts commit 1fe3f466.
This reverts commit 7731726a.
This reverts commit eb2016c4.
parent a5f682ef
This diff is collapsed.
...@@ -64,7 +64,6 @@ extends = ...@@ -64,7 +64,6 @@ extends =
../../component/wget/buildout.cfg ../../component/wget/buildout.cfg
../../component/aspell/buildout.cfg ../../component/aspell/buildout.cfg
../../component/cloudooo/buildout.cfg ../../component/cloudooo/buildout.cfg
../../component/6tunnel/buildout.cfg
parts = parts =
rdiff-backup rdiff-backup
...@@ -139,11 +138,6 @@ parts = ...@@ -139,11 +138,6 @@ parts =
# Create instance template # Create instance template
template template
[download-base]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:filename}
mode = 640
# Local development # Local development
[slapos.cookbook-repository] [slapos.cookbook-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
...@@ -184,36 +178,63 @@ context = ...@@ -184,36 +178,63 @@ context =
${:extra-context} ${:extra-context}
[template-mariadb] [template-mariadb]
< = download-base < = template-jinja2-base
filename = instance-mariadb.cfg.in filename = instance-mariadb.cfg
md5sum = ed3ca668c8b3c4729bf3e1b986c14b5a md5sum = 867bd8e3c4f56db2aab2fcad59f2efd8
extra-context =
key coreutils_location coreutils:location
key dcron_location dcron:location
key gettext_location gettext:location
key grep_location grep:location
key gzip_location gzip:location
key logrotate_location logrotate:location
key mariadb_location mariadb:location
key perl_location perl:location
key perl_siteprefix perl:siteprefix
key sed_location sed:location
key xtrabackup_location xtrabackup:location
[template-zope] [template-zope]
< = download-base recipe = slapos.recipe.build:download
filename = instance-zope.cfg.in url = ${:_profile_base_location_}/instance-zope.cfg.in
md5sum = 7b1b6ee1fd122f5590844a90853622dc md5sum = d5981dbe595004c707dd1744be1fe753
mode = 640
[template-kumofs] [template-kumofs]
< = download-base < = template-jinja2-base
filename = instance-kumofs.cfg.in filename = instance-kumofs.cfg
md5sum = 62759c4cbb586bd4d0dcf82c08654e7a md5sum = 7e13d689de7163dcab64e8df4711cdd7
extra-context =
key dash_location dash:location
key dcron_location dcron:location
key gzip_location gzip:location
key kumo_location kumo:location
key logrotate_location logrotate:location
[template-tidstorage]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-tidstorage.cfg.in
md5sum = 5e0c5de5bc17947c152de73b329a5a02
mode = 640
[template-cloudooo] [template-cloudooo]
< = download-base recipe = slapos.recipe.build:download
filename = instance-cloudoo.cfg.in url = ${:_profile_base_location_}/instance-cloudoo.cfg.in
md5sum = 24fc2dccc7ec20ec317ac4a9530ce6ac md5sum = 53492e520be57f4c6a9eacd107c8d446
mode = 640
[template-zope-conf] [template-zope-conf]
< = download-base recipe = slapos.recipe.build:download
filename = zope.conf.in url = ${:_profile_base_location_}/zope.conf.in
md5sum = c4c42d06c63d33de703fc03415e34d84 md5sum = bc2154161a1d5baddc4ed4dfaaf94fbe
mode = 640
[template] [template]
< = template-jinja2-base < = template-jinja2-base
# 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 = 2d9fa15edcc5d336b79a602d2c24d7e6 md5sum = bee6c2b640efee53e3b6e209127cb0bc
extra-context = extra-context =
key apache_location apache:location key apache_location apache:location
key aspell_location aspell:location key aspell_location aspell:location
...@@ -228,14 +249,12 @@ extra-context = ...@@ -228,14 +249,12 @@ extra-context =
key fontconfig_location fontconfig:location key fontconfig_location fontconfig:location
key fonts_location fonts:location key fonts_location fonts:location
key freetype_location freetype:location key freetype_location freetype:location
key gettext_location gettext:location
key git_location git:location key git_location git:location
key graphviz_location graphviz:location key graphviz_location graphviz:location
key grep_location grep:location key grep_location grep:location
key gzip_location gzip:location key gzip_location gzip:location
key haproxy_location haproxy:location key haproxy_location haproxy:location
key imagemagick_location imagemagick:location key imagemagick_location imagemagick:location
key kumo_location kumo:location
key libICE_location libICE:location key libICE_location libICE:location
key libSM_location libSM:location key libSM_location libSM:location
key libX11_location libX11:location key libX11_location libX11:location
...@@ -250,77 +269,51 @@ extra-context = ...@@ -250,77 +269,51 @@ extra-context =
key local_bt5_repository local-bt5-repository:list key local_bt5_repository local-bt5-repository:list
key logrotate_location logrotate:location key logrotate_location logrotate:location
key mariadb_location mariadb:location key mariadb_location mariadb:location
key memcached_location memcached:location
key openssl_location openssl:location key openssl_location openssl:location
key perl_location perl:location
key perl_siteprefix perl:siteprefix
key pdftk_location pdftk:location key pdftk_location pdftk:location
key poppler_location poppler:location key poppler_location poppler:location
key sed_location sed:location key sed_location sed:location
key template_balancer template-balancer:target
key template_cloudooo template-cloudooo:target key template_cloudooo template-cloudooo:target
key template_cluster_zope template-cluster-zope:target
key template_erp5_single template-erp5-single:target key template_erp5_single template-erp5-single:target
key template_erp5_cluster template-erp5-cluster:target key template_erp5_cluster template-erp5-cluster:target
key template_kumofs template-kumofs:target key template_kumofs template-kumofs:rendered
key template_logrotate_base template-logrotate-base:rendered key template_mariadb template-mariadb:rendered
key template_mariadb template-mariadb:target key template_memcached template-memcached:rendered
key template_memcached template-memcached:target key template_tidstorage template-tidstorage:target
key template_varnish template-varnish:target key template_varnish template-varnish:target
key template_zeo template-zeo:target
key template_zope template-zope:target key template_zope template-zope:target
key template_zope_conf template-zope-conf:target key template_zope_conf template-zope-conf:target
key tesseract_location tesseract:location key tesseract_location tesseract:location
key sixtunnel_location 6tunnel:location
key varnish_location varnish-3.0:location key varnish_location varnish-3.0:location
key w3m_location w3m:location key w3m_location w3m:location
key wget_location wget:location key wget_location wget:location
key xtrabackup_location xtrabackup:location
key zlib_location zlib:location key zlib_location zlib:location
[template-memcached] [template-memcached]
< = download-base < = template-jinja2-base
filename = instance-memcached.cfg.in filename = instance-memcached.cfg
md5sum = 25bffcb311aa0a202e68399a413fd780 md5sum = 44c507e9eec1003beb99f9063b5e09be
extra-context =
key dash_location dash:location
key memcached_location memcached:location
[template-erp5-single] [template-erp5-single]
< = download-base recipe = slapos.recipe.build:download
filename = instance-erp5-single.cfg.in url = ${:_profile_base_location_}/instance-erp5-single.cfg.in
md5sum = f82d59347fdf707ffd671654d318ca70 md5sum = 2a4312202a3160f874c4fa3ee9155a1d
mode = 640
[template-erp5-cluster] [template-erp5-cluster]
< = download-base recipe = slapos.recipe.build:download
filename = instance-erp5-cluster.cfg.in url = ${:_profile_base_location_}/instance-erp5-cluster.cfg.in
md5sum = b044df76edad94dc5bfc2729e3041573 md5sum = eecde68b9a266d8883042540ac077839
mode = 640
[template-zeo]
< = download-base
filename = instance-zeo.cfg.in
md5sum = 9d49e6787600a416545a8ff228abb720
[template-cluster-zope]
< = download-base
filename = instance-cluster-zope.cfg.in
md5sum = 22c351ae5edd507e8cd3de1abeb705f3
[template-balancer]
< = download-base
filename = instance-balancer.cfg.in
md5sum = 787fa10c0dc4e607706c572ba8e06386
[template-logrotate-base]
< = template-jinja2-base
filename = instance-logrotate-base.cfg
md5sum = af19ff0c7817df85987c69738fb083f2
extra-context =
key dcron_location dcron:location
key gzip_location gzip:location
key logrotate_location logrotate:location
[template-varnish] [template-varnish]
< = download-base recipe = slapos.recipe.build:download
filename = instance-varnish.cfg.in url = ${:_profile_base_location_}/instance-varnish.cfg.in
md5sum = f7c47ffc3e23e07f81eb4ca172286ccc md5sum = 17aee2df57b121343b1fd65f4b51ce80
mode = 640
[bt5-repository] [bt5-repository]
# Format: # Format:
...@@ -624,7 +617,7 @@ polib = 1.0.0 ...@@ -624,7 +617,7 @@ polib = 1.0.0
psutil = 0.6.1 psutil = 0.6.1
python-ldap = 2.4.10 python-ldap = 2.4.10
python-magic = 0.4.3 python-magic = 0.4.3
python-memcached = 1.47-ipv6-1 python-memcached = 1.47
restkit = 4.2.0 restkit = 4.2.0
rtjp-eventlet = 0.3.2 rtjp-eventlet = 0.3.2
setuptools = 0.6c12dev-r88846 setuptools = 0.6c12dev-r88846
......
{% if software_type == slap_software_type -%}
{% set part_list = [] -%}
{% macro section(name) %}{% do part_list.append(name) %}{{ name }}{% endmacro -%}
{% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%}
{#
XXX: This template only supports exactly one IPv4 and (if ipv6 is used) one IPv6
per partition. No more (undefined result), no less (IndexError).
-#}
# TODO: insert varnish between apache & haproxy.
# And think of a way to specify which urls goe through varnish, which go
# directly to haproxy. (maybe just passing literal configuration file chunk)
{% set ipv4 = (ipv4_set | list)[0] -%}
{% if use_ipv6 -%}
{% set ipv6 = (ipv6_set | list)[0] -%}
[zope-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 }}
{% endif -%}
{% set haproxy_dict = {} -%}
{% set apache_dict = {} -%}
{% set next_port = 9000 -%}
{% for family_name, parameter_id_list in slapparameter_dict['zope-family-dict'].items() -%}
{% set zope_family_address_list = [] -%}
{% for parameter_id in parameter_id_list -%}
{% set zope_address_list = slapparameter_dict[parameter_id] -%}
{% for zope_address in zope_address_list -%}
{% if use_ipv6 -%}
[{{ section('zope-tunnel-' ~ next_port) }}]
< = zope-tunnel-base
base-name = {{ 'zeo-tunnel-' ~ next_port }}
ipv4-port = {{ next_port }}
ipv6-port = {{ zope_address.split(']:')[1] }}
ipv6 = {{ zope_address.split(']:')[0][1:] }}
{% set zope_effective_address = ipv4 ~ ":" ~ next_port -%}
{% set next_port = next_port + 1 -%}
{% else -%}
{% set zope_effective_address = zope_address -%}
{% endif -%}
{% do zope_family_address_list.append(zope_effective_address) -%}
{% endfor -%}
{% endfor -%}
{% set haproxy_port = next_port -%}
{% set next_port = next_port + 1 -%}
{% do haproxy_dict.__setitem__(family_name, (haproxy_port, zope_family_address_list)) -%}
{% do apache_dict.__setitem__(family_name, (next_port, 'http://' ~ ipv4 ~ ':' ~ haproxy_port)) -%}
{% set next_port = next_port + 1 -%}
{% endfor -%}
[haproxy]
recipe = slapos.cookbook:haproxy
conf-path = ${directory:etc}/haproxy.cfg
ip = {{ ipv4 }}
maxconn = {{ slapparameter_dict['haproxy-maxconn'] }}
server-check-path = {{ slapparameter_dict['haproxy-server-check-path'] }}
wrapper-path = ${directory:services}/haproxy
binary-path = {{ parameter_dict['haproxy'] }}/sbin/haproxy
backend-dict = {{ dumps(haproxy_dict) }}
[apache]
recipe = slapos.cookbook:apache.zope.backend
backend-list = {{ dumps(apache_dict.values()) }}
ip = {% if use_ipv6 %}{{ ipv6 }}{% else %}{{ ipv4 }}{% endif %}
wrapper = ${directory:bin}/apache
scheme = https
key-file = ${directory:apache-conf}/apache.key
cert-file = ${directory:apache-conf}/apache.crt
configuration-file = ${directory:apache-conf}/apache.conf
access-control-string = {{ slapparameter_dict['apache-access-control-string'] }}
pid-file = ${directory:run}/apache.pid
lock-file = ${directory:run}/apache.lock
ssl-session-cache = $${directory:log}/apache-ssl-session-cache
error-log = ${directory:log}/apache-error.log
access-log = ${directory:log}/apache-access.log
apache-binary = {{ parameter_dict['apache'] }}/bin/httpd
ssl-authentication = {{ slapparameter_dict['apache-ssl-authentication'] }}
backend-path = {{ slapparameter_dict['apache-backend-path'] }}
# Note: Without certificate-authority main certificate have to be hardcoded
ssl-authentication-certificate = ${certificate-authority:ca-dir}/cacert.pem
ssl-authentication-crl = ${certificate-authority:ca-crl}
[publish]
recipe = slapos.cookbook:publish.serialised
{% for family_name, (apache_port, _) in apache_dict.items() -%}
{% if use_ipv6 -%}
{{ family_name }} = ${apache:scheme}://[${apache:ip}]:{{ apache_port }}
{% else -%}
{{ family_name }} = ${apache:scheme}://${apache:ip}:{{ apache_port }}
{% endif -%}
{% endfor -%}
[certificate-authority]
recipe = slapos.cookbook:certificate_authority
openssl-binary = {{ parameter_dict['openssl'] }}/bin/openssl
ca-dir = ${directory:ca-dir}
requests-directory = ${directory:requests}
wrapper = ${directory:services}/ca
ca-private = ${directory:private}
ca-certs = ${directory:certs}
ca-newcerts = ${directory:newcerts}
ca-crl = ${directory:crl}
{% set ca = slapparameter_dict['ca'] -%}
country-code = {{ ca.get('country-code', 'ZZ') }}
email = {{ ca.get('email', 'nobody@example.com') }}
state = {{ ca.get('state', 'Dummy State') }}
city = {{ ca.get('city', 'Dummy City') }}
company = {{ ca.get('company', 'Dummy Company') }}
[ca-apache]
< = certificate-authority
recipe = slapos.cookbook:certificate_authority.request
key-file = ${apache:key-file}
cert-file = ${apache:cert-file}
executable = ${apache:wrapper}
wrapper = ${directory:services}/apache
[logrotate-apache]
recipe = slapos.cookbook:logrotate.d
logrotate-entries = ${logrotate:logrotate-entries}
backup = ${logrotate:backup}
name = apache
log = ${apache:error-log} ${apache:access-log}
post = {{ parameter_dict['bin-directory'] }}/killpidfromfile ${apache:pid-file} SIGUSR1
[directory]
recipe = slapos.cookbook:mkdirectory
apache-conf = ${:etc}/apache
bin = ${buildout:directory}/bin
etc = ${buildout:directory}/etc
services = ${:etc}/run
var = ${buildout:directory}/var
run = ${:var}/run
log = ${:var}/log
ca-dir = ${buildout:directory}/srv/ssl
requests = ${:ca-dir}/requests
private = ${:ca-dir}/private
certs = ${:ca-dir}/certs
newcerts = ${:ca-dir}/newcerts
crl = ${:ca-dir}/crl
[buildout]
extends = {{ parameter_dict['instance-logrotate-cfg'] }}
parts +=
publish
logrotate-apache
haproxy
ca-apache
{{ part_list | join('\n ') }}
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
{% endif %}
{% if software_type == slap_software_type -%} {% if software_type == slap_software_type -%}
{% set json = json_module.loads(parameter_dict.get('cloudooo-json', '{}')) -%} {% set json = json_module.loads(parameter_dict.get('cloudooo-json', '{}')) -%}
{% set bin_directory = parameter_dict['buildout-bin-directory'] -%} {% set bin_directory = parameter_dict['buildout-bin-directory'] -%}
{% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%}
[buildout] [buildout]
parts = parts =
publish-cloudooo-connection-information publish-cloudooo-connection-information
cloudooo-instance cloudooo-instance
promise promise
promise-openoffice promise-openoffice
{% if use_ipv6 -%}
promise-tunnel
{% endif -%}
eggs-directory = {{ eggs_directory }} eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }} develop-eggs-directory = {{ develop_eggs_directory }}
offline = true offline = true
[publish-cloudooo-connection-information] [publish-cloudooo-connection-information]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publishurl
{% if use_ipv6 -%}
url = cloudooo://[${ipv6toipv4:ipv6}]:${ipv6toipv4:ipv6-port}/
{% else -%}
url = cloudooo://${cloudooo-instance:ip}:${cloudooo-instance:port}/ url = cloudooo://${cloudooo-instance:ip}:${cloudooo-instance:port}/
{% endif -%}
[cloudooo-instance] [cloudooo-instance]
recipe = slapos.cookbook:generic.cloudooo recipe = slapos.cookbook:generic.cloudooo
...@@ -69,25 +61,6 @@ path = ${directory:promise}/openoffice ...@@ -69,25 +61,6 @@ path = ${directory:promise}/openoffice
hostname = ${cloudooo-instance:ip} hostname = ${cloudooo-instance:ip}
port = ${cloudooo-instance:openoffice-port} port = ${cloudooo-instance:openoffice-port}
{% if use_ipv6 -%}
[promise-tunnel]
recipe = slapos.cookbook:check_port_listening
path = ${directory:promise}/tunnel
hostname = ${ipv6toipv4:ipv6}
port = ${ipv6toipv4:ipv6-port}
[ipv6toipv4]
recipe = slapos.cookbook:ipv6toipv4
runner-path = ${directory:service}/${:base-name}
6tunnel-path = {{ parameter_dict['6tunnel'] }}/bin/6tunnel
shell-path = {{ parameter_dict['dash'] }}/bin/dash
ipv4 = ${cloudooo-instance:ip}
ipv6 = {{ (ipv6_set | list)[0] }}
ipv6-port = ${cloudooo-instance:port}
ipv4-port = ${cloudooo-instance:port}
base-name = cloudooo-tunnel
{% endif -%}
# rest of parts are candidates for some generic stuff # rest of parts are candidates for some generic stuff
[directory] [directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
......
This diff is collapsed.
This diff is collapsed.
...@@ -87,7 +87,7 @@ bt5 = ${slap-parameter:bt5} ...@@ -87,7 +87,7 @@ bt5 = ${slap-parameter:bt5}
bt5-repository-url = ${slap-parameter:bt5-repository-url} bt5-repository-url = ${slap-parameter:bt5-repository-url}
[request-common] [request-common]
recipe = slapos.cookbook:request.serialised recipe = slapos.cookbook:request
software-url = ${slap-connection:software-release-url} software-url = ${slap-connection:software-release-url}
sla = computer_guid sla = computer_guid
sla-computer_guid = ${slap-connection:computer-id} sla-computer_guid = ${slap-connection:computer-id}
......
{% if software_type == slap_software_type -%}
{% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%}
[buildout] [buildout]
parts = parts =
publish-kumofs-connection-information publish-kumofs-connection-information
...@@ -18,24 +16,14 @@ develop-eggs-directory = {{ develop_eggs_directory }} ...@@ -18,24 +16,14 @@ develop-eggs-directory = {{ develop_eggs_directory }}
offline = true offline = true
[publish-kumofs-connection-information] [publish-kumofs-connection-information]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publishurl
{% if use_ipv6 -%}
url = memcached://[${kumofs-instance:ip}]:${kumofs-instance:gateway-port}/
{% else -%}
url = memcached://${kumofs-instance:ip}:${kumofs-instance:gateway-port}/ url = memcached://${kumofs-instance:ip}:${kumofs-instance:gateway-port}/
{% endif -%}
[kumofs-instance] [kumofs-instance]
recipe = slapos.cookbook:generic.kumofs recipe = slapos.cookbook:generic.kumofs
# Network options # Network options
{% if use_ipv6 -%}
ip = ${slap-network-information:global-ipv6}
address-family = inet6
{% else -%}
ip = ${slap-network-information:local-ipv4} ip = ${slap-network-information:local-ipv4}
address-family = inet4
{% endif -%}
manager-port = 13101 manager-port = 13101
server-port = 13201 server-port = 13201
server-listen-port = 13202 server-listen-port = 13202
...@@ -55,10 +43,10 @@ kumo-manager-log = ${basedirectory:log}/kumo-manager.log ...@@ -55,10 +43,10 @@ kumo-manager-log = ${basedirectory:log}/kumo-manager.log
kumo-server-log = ${basedirectory:log}/kumo-server.log kumo-server-log = ${basedirectory:log}/kumo-server.log
# Binary information # Binary information
kumo-gateway-binary = {{ parameter_dict['kumo-location'] }}/bin/kumo-gateway kumo-gateway-binary = {{ kumo_location }}/bin/kumo-gateway
kumo-manager-binary = {{ parameter_dict['kumo-location'] }}/bin/kumo-manager kumo-manager-binary = {{ kumo_location }}/bin/kumo-manager
kumo-server-binary = {{ parameter_dict['kumo-location'] }}/bin/kumo-server kumo-server-binary = {{ kumo_location }}/bin/kumo-server
shell-path = {{ parameter_dict['dash-location'] }}/bin/dash shell-path = {{ dash_location }}/bin/dash
[logrotate-entry-kumofs] [logrotate-entry-kumofs]
<= logrotate <= logrotate
...@@ -72,9 +60,9 @@ log = ${kumofs-instance:kumo-gateway-log} ${kumofs-instance:kumo-manager-log} ...@@ -72,9 +60,9 @@ log = ${kumofs-instance:kumo-gateway-log} ${kumofs-instance:kumo-manager-log}
[logrotate] [logrotate]
recipe = slapos.cookbook:logrotate recipe = slapos.cookbook:logrotate
# Binaries # Binaries
logrotate-binary = {{ parameter_dict['logrotate-location'] }}/usr/sbin/logrotate logrotate-binary = {{ logrotate_location }}/usr/sbin/logrotate
gzip-binary = {{ parameter_dict['gzip-location'] }}/bin/gzip gzip-binary = {{ gzip_location }}/bin/gzip
gunzip-binary = {{ parameter_dict['gzip-location'] }}/bin/gunzip gunzip-binary = {{ gzip_location }}/bin/gunzip
# Directories # Directories
wrapper = ${rootdirectory:bin}/logrotate wrapper = ${rootdirectory:bin}/logrotate
conf = ${rootdirectory:etc}/logrotate.conf conf = ${rootdirectory:etc}/logrotate.conf
...@@ -108,7 +96,7 @@ bin = ${buildout:directory}/bin ...@@ -108,7 +96,7 @@ bin = ${buildout:directory}/bin
[cron] [cron]
recipe = slapos.cookbook:cron recipe = slapos.cookbook:cron
dcrond-binary = {{ parameter_dict['dcron-location'] }}/sbin/crond dcrond-binary = {{ dcron_location }}/sbin/crond
cron-entries = ${directory:cron-entries} cron-entries = ${directory:cron-entries}
crontabs = ${directory:crontabs} crontabs = ${directory:crontabs}
cronstamps = ${directory:cronstamps} cronstamps = ${directory:cronstamps}
...@@ -149,4 +137,3 @@ port = ${kumofs-instance:gateway-port} ...@@ -149,4 +137,3 @@ port = ${kumofs-instance:gateway-port}
[promise-kumofs-manager] [promise-kumofs-manager]
<= promise-template <= promise-template
port = ${kumofs-instance:manager-port} port = ${kumofs-instance:manager-port}
{% endif %}
[buildout]
parts =
cron-entry-logrotate
[cron]
recipe = slapos.cookbook:cron
cron-entries = ${logrotate-directory:cron-entries}
dcrond-binary = {{ dcron_location }}/sbin/crond
crontabs = ${logrotate-directory:crontabs}
cronstamps = ${logrotate-directory:cronstamps}
catcher = ${cron-simplelogger:wrapper}
binary = ${logrotate-directory:services}/crond
[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
wrapper = ${logrotate-directory:bin}/cron_simplelogger
log = ${logrotate-directory:log}/cron.log
[logrotate]
recipe = slapos.cookbook:logrotate
logrotate-entries = ${logrotate-directory:logrotate-entries}
backup = ${logrotate-directory:logrotate-backup}
logrotate-binary = {{ logrotate_location }}/usr/sbin/logrotate
gzip-binary = {{ gzip_location }}/bin/gzip
gunzip-binary = {{ gzip_location }}/bin/gunzip
wrapper = ${logrotate-directory:bin}/logrotate
conf = ${logrotate-directory:etc}/logrotate.conf
state-file = ${logrotate-directory:srv}/logrotate.status
[cron-entry-logrotate]
recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries}
name = logrotate
frequency = 0 0 * * *
command = ${logrotate:wrapper}
[logrotate-directory]
recipe = slapos.cookbook:mkdirectory
cron-entries = ${:etc}/cron.d
cronstamps = ${:etc}/cronstamps
crontabs = ${:etc}/crontabs
logrotate-backup = ${:backup}/logrotate
logrotate-entries = ${:etc}/logrotate.d
bin = ${buildout:directory}/bin
srv = ${buildout:directory}/srv
backup = ${:srv}/backup
etc = ${buildout:directory}/etc
services = ${:etc}/run
log = ${buildout:directory}/var/log
{% if software_type == slap_software_type -%}
{% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%}
[buildout] [buildout]
parts = parts =
publish-mariadb-url publish-mariadb-url
...@@ -17,12 +15,8 @@ develop-eggs-directory = {{ develop_eggs_directory }} ...@@ -17,12 +15,8 @@ develop-eggs-directory = {{ develop_eggs_directory }}
offline = true offline = true
[publish-mariadb-url] [publish-mariadb-url]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publishurl
{% if use_ipv6 -%}
url = mysql://${mariadb-instance:user}:${mariadb-instance:password}@[${mariadb-instance:ip}]:${mariadb-instance:port}/${mariadb-instance:database}
{% else -%}
url = mysql://${mariadb-instance:user}:${mariadb-instance:password}@${mariadb-instance:ip}:${mariadb-instance:port}/${mariadb-instance:database} url = mysql://${mariadb-instance:user}:${mariadb-instance:password}@${mariadb-instance:ip}:${mariadb-instance:port}/${mariadb-instance:database}
{% endif -%}
[cron-entry-mariadb-backup] [cron-entry-mariadb-backup]
<= cron <= cron
...@@ -36,13 +30,9 @@ recipe = slapos.cookbook:generic.mysql ...@@ -36,13 +30,9 @@ recipe = slapos.cookbook:generic.mysql
# Options # Options
user = user user = user
parallel-test-database-amount = {{ slapparameter_dict.get('test-database-amount', 100) }} parallel-test-database-amount = ${slap-parameter:test-database-amount}
port = 45678 port = 45678
{% if use_ipv6 -%} ip = ${slap-network-information:local-ipv4}
ip = {{ (ipv6_set | list)[0] }}
{% else -%}
ip = {{ (ipv4_set | list)[0] }}
{% endif -%}
database = erp5 database = erp5
test-user = erp5_test test-user = erp5_test
test-database = erp5_test test-database = erp5_test
...@@ -66,46 +56,46 @@ innobackupex-incremental = ${rootdirectory:bin}/innobackupex-incremental ...@@ -66,46 +56,46 @@ innobackupex-incremental = ${rootdirectory:bin}/innobackupex-incremental
innobackupex-full = ${rootdirectory:bin}/innobackupex-full innobackupex-full = ${rootdirectory:bin}/innobackupex-full
# Binary information # Binary information
innobackupex-binary = {{ parameter_dict['xtrabackup-location'] }}/bin/innobackupex innobackupex-binary = {{ xtrabackup_location }}/bin/innobackupex
mysql-base-directory = {{ parameter_dict['mariadb-location'] }} mysql-base-directory = {{ mariadb_location }}
mysql-binary = {{ parameter_dict['mariadb-location'] }}/bin/mysql mysql-binary = {{ mariadb_location }}/bin/mysql
mysql-install-binary = {{ parameter_dict['mariadb-location'] }}/scripts/mysql_install_db mysql-install-binary = {{ mariadb_location }}/scripts/mysql_install_db
mysql-upgrade-binary = {{ parameter_dict['mariadb-location'] }}/bin/mysql_upgrade mysql-upgrade-binary = {{ mariadb_location }}/bin/mysql_upgrade
mysqld-binary = {{ parameter_dict['mariadb-location'] }}/bin/mysqld mysqld-binary = {{ mariadb_location }}/bin/mysqld
pt-archiver-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-archiver pt-archiver-binary = {{ perl_siteprefix }}/bin/pt-archiver
pt-config-diff-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-config-diff pt-config-diff-binary = {{ perl_siteprefix }}/bin/pt-config-diff
pt-deadlock-logger-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-deadlock-logger pt-deadlock-logger-binary = {{ perl_siteprefix }}/bin/pt-deadlock-logger
pt-duplicate-key-checker-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-duplicate-key-checker pt-duplicate-key-checker-binary = {{ perl_siteprefix }}/bin/pt-duplicate-key-checker
pt-fifo-split-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-fifo-split pt-fifo-split-binary = {{ perl_siteprefix }}/bin/pt-fifo-split
pt-find-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-find pt-find-binary = {{ perl_siteprefix }}/bin/pt-find
pt-fk-error-logger-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-fk-error-logger pt-fk-error-logger-binary = {{ perl_siteprefix }}/bin/pt-fk-error-logger
pt-heartbeat-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-heartbeat pt-heartbeat-binary = {{ perl_siteprefix }}/bin/pt-heartbeat
pt-index-usage-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-index-usage pt-index-usage-binary = {{ perl_siteprefix }}/bin/pt-index-usage
pt-kill-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-kill pt-kill-binary = {{ perl_siteprefix }}/bin/pt-kill
pt-log-player-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-log-player pt-log-player-binary = {{ perl_siteprefix }}/bin/pt-log-player
pt-online-schema-change-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-online-schema-change pt-online-schema-change-binary = {{ perl_siteprefix }}/bin/pt-online-schema-change
pt-query-advisor-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-query-advisor pt-query-advisor-binary = {{ perl_siteprefix }}/bin/pt-query-advisor
pt-query-digest-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-query-digest pt-query-digest-binary = {{ perl_siteprefix }}/bin/pt-query-digest
pt-show-grants-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-show-grants pt-show-grants-binary = {{ perl_siteprefix }}/bin/pt-show-grants
pt-slave-delay-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-slave-delay pt-slave-delay-binary = {{ perl_siteprefix }}/bin/pt-slave-delay
pt-slave-find-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-slave-find pt-slave-find-binary = {{ perl_siteprefix }}/bin/pt-slave-find
pt-slave-restart-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-slave-restart pt-slave-restart-binary = {{ perl_siteprefix }}/bin/pt-slave-restart
pt-table-checksum-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-table-checksum pt-table-checksum-binary = {{ perl_siteprefix }}/bin/pt-table-checksum
pt-table-sync-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-table-sync pt-table-sync-binary = {{ perl_siteprefix }}/bin/pt-table-sync
pt-tcp-model-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-tcp-model pt-tcp-model-binary = {{ perl_siteprefix }}/bin/pt-tcp-model
pt-trend-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-trend pt-trend-binary = {{ perl_siteprefix }}/bin/pt-trend
pt-upgrade-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-upgrade pt-upgrade-binary = {{ perl_siteprefix }}/bin/pt-upgrade
pt-variable-advisor-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-variable-advisor pt-variable-advisor-binary = {{ perl_siteprefix }}/bin/pt-variable-advisor
pt-visual-explain-binary = {{ parameter_dict['perl-siteprefix'] }}/bin/pt-visual-explain pt-visual-explain-binary = {{ perl_siteprefix }}/bin/pt-visual-explain
xtrabackup-binary = {{ parameter_dict['xtrabackup-location'] }}/bin/xtrabackup_51 xtrabackup-binary = {{ xtrabackup_location }}/bin/xtrabackup_51
perl-binary = {{ parameter_dict['perl-location'] }}/bin/perl perl-binary = {{ perl_location }}/bin/perl
[logrotate] [logrotate]
recipe = slapos.cookbook:logrotate recipe = slapos.cookbook:logrotate
# Binaries # Binaries
logrotate-binary = {{ parameter_dict['logrotate-location'] }}/usr/sbin/logrotate logrotate-binary = {{ logrotate_location }}/usr/sbin/logrotate
gzip-binary = {{ parameter_dict['gzip-location'] }}/bin/gzip gzip-binary = {{ gzip_location }}/bin/gzip
gunzip-binary = {{ parameter_dict['gzip-location'] }}/bin/gunzip gunzip-binary = {{ gzip_location }}/bin/gunzip
# Directories # Directories
wrapper = ${rootdirectory:bin}/logrotate wrapper = ${rootdirectory:bin}/logrotate
conf = ${rootdirectory:etc}/logrotate.conf conf = ${rootdirectory:etc}/logrotate.conf
...@@ -118,11 +108,11 @@ state-file = ${rootdirectory:srv}/logrotate.status ...@@ -118,11 +108,11 @@ state-file = ${rootdirectory:srv}/logrotate.status
recipe = slapos.cookbook:logrotate.d recipe = slapos.cookbook:logrotate.d
name = mariadb name = mariadb
log = ${mariadb-instance:error-log} ${mariadb-instance:slow-query-log} log = ${mariadb-instance:error-log} ${mariadb-instance:slow-query-log}
post = "${mariadb-instance:mysql-binary}" --no-defaults -B --socket="${mariadb-instance:socket}" -u root -e "FLUSH LOGS" post = ${mariadb-instance:mysql-binary} --no-defaults -B --socket=${mariadb-instance:socket} -e "FLUSH LOGS"
[cron] [cron]
recipe = slapos.cookbook:cron recipe = slapos.cookbook:cron
dcrond-binary = {{ parameter_dict['dcron-location'] }}/sbin/crond dcrond-binary = {{ dcron_location }}/sbin/crond
cron-entries = ${directory:cron-entries} cron-entries = ${directory:cron-entries}
crontabs = ${directory:crontabs} crontabs = ${directory:crontabs}
cronstamps = ${directory:cronstamps} cronstamps = ${directory:cronstamps}
...@@ -145,16 +135,16 @@ command = ${logrotate:wrapper} ...@@ -145,16 +135,16 @@ command = ${logrotate:wrapper}
recipe = slapos.cookbook:symbolic.link recipe = slapos.cookbook:symbolic.link
target-directory = ${rootdirectory:bin} target-directory = ${rootdirectory:bin}
link-binary = link-binary =
{{ parameter_dict['coreutils-location'] }}/bin/basename {{ coreutils_location }}/bin/basename
{{ parameter_dict['coreutils-location'] }}/bin/cat {{ coreutils_location }}/bin/cat
{{ parameter_dict['coreutils-location'] }}/bin/cp {{ coreutils_location }}/bin/cp
{{ parameter_dict['coreutils-location'] }}/bin/ls {{ coreutils_location }}/bin/ls
{{ parameter_dict['coreutils-location'] }}/bin/tr {{ coreutils_location }}/bin/tr
{{ parameter_dict['coreutils-location'] }}/bin/uname {{ coreutils_location }}/bin/uname
{{ parameter_dict['gettext-location'] }}/lib/gettext/hostname {{ gettext_location }}/lib/gettext/hostname
{{ parameter_dict['grep-location'] }}/bin/grep {{ grep_location }}/bin/grep
{{ parameter_dict['sed-location'] }}/bin/sed {{ sed_location }}/bin/sed
{{ parameter_dict['mariadb-location'] }}/bin/mysql {{ mariadb_location }}/bin/mysql
[rootdirectory] [rootdirectory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
...@@ -188,4 +178,6 @@ recipe = slapos.cookbook:check_port_listening ...@@ -188,4 +178,6 @@ recipe = slapos.cookbook:check_port_listening
path = ${basedirectory:promise}/mariadb path = ${basedirectory:promise}/mariadb
hostname = ${mariadb-instance:ip} hostname = ${mariadb-instance:ip}
port = ${mariadb-instance:port} port = ${mariadb-instance:port}
{% endif %}
[slap-parameter]
test-database-amount = 100
{% if software_type == slap_software_type -%} #############################
{% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%} #
# Instanciate memcached
#
# No slapos parameter needed
#
#############################
[buildout] [buildout]
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
parts = parts =
memcached-instance
publish-memcached-connection-information publish-memcached-connection-information
memcache-promise promise
{% if use_ipv6 -%}
tunnel-promise
[ipv6toipv4]
recipe = slapos.cookbook:ipv6toipv4
runner-path = ${directory:service}/${:base-name}
6tunnel-path = {{ parameter_dict['6tunnel-location'] }}/bin/6tunnel
shell-path = {{ parameter_dict['dash-location'] }}/bin/dash
ipv4 = ${memcached-instance:ip}
ipv6 = ${slap-network-information:global-ipv6}
ipv6-port = ${memcached-instance:port}
ipv4-port = ${memcached-instance:port}
base-name = memcached-tunnel
[tunnel-promise] eggs-directory = {{ eggs_directory }}
recipe = slapos.cookbook:check_port_listening develop-eggs-directory = {{ develop_eggs_directory }}
path = ${directory:promise}/tunnel offline = true
hostname = ${ipv6toipv4:ipv6}
port = ${ipv6toipv4:ipv6-port}
{% endif -%}
[directory] [directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
...@@ -38,22 +25,18 @@ promise = ${:etc}/promise ...@@ -38,22 +25,18 @@ promise = ${:etc}/promise
[memcached-instance] [memcached-instance]
recipe = slapos.cookbook:generic.memcached recipe = slapos.cookbook:generic.memcached
wrapper_path = ${directory:service}/memcached wrapper_path = ${directory:service}/memcached
binary_path = {{ parameter_dict['memcached-location'] }}/bin/memcached binary_path = {{ memcached_location }}/bin/memcached
shell-path = {{ parameter_dict['dash-location'] }}/bin/dash shell-path = {{ dash_location }}/bin/dash
ip = ${slap-network-information:local-ipv4} ip = ${slap-network-information:local-ipv4}
port = 11000 port = 11000
[publish-memcached-connection-information] [publish-memcached-connection-information]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publishurl
{% if use_ipv6 -%}
url = memcached://[${ipv6toipv4:ipv6}]:${ipv6toipv4:ipv6-port}/
{% else -%}
url = memcached://${memcached-instance:ip}:${memcached-instance:port}/ url = memcached://${memcached-instance:ip}:${memcached-instance:port}/
{% endif -%}
[memcache-promise] # Deploy zope promises scripts
[promise]
recipe = slapos.cookbook:check_port_listening recipe = slapos.cookbook:check_port_listening
path = ${directory:promise}/memcache path = ${directory:promise}/memcache
hostname = ${memcached-instance:ip} hostname = ${memcached-instance:ip}
port = ${memcached-instance:port} port = ${memcached-instance:port}
{% endif %}
This diff is collapsed.
...@@ -17,7 +17,7 @@ develop-eggs-directory = {{ develop_eggs_directory }} ...@@ -17,7 +17,7 @@ develop-eggs-directory = {{ develop_eggs_directory }}
offline = true offline = true
[publish-varnish-connection-information] [publish-varnish-connection-information]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publishurl
url = http://${varnish-instance:ip}:${varnish-instance:server-port}/ url = http://${varnish-instance:ip}:${varnish-instance:server-port}/
[varnish-instance] [varnish-instance]
......
{% if software_type == slap_software_type -%}
{% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%}
{% set next_port = 2000 -%}
{% set part_list = [] -%}
{% set storage_dict = {} -%}
{% set zodb_dict = {} -%}
{% set tidstorage_dict = slapparameter_dict.get('tidstorage-dict') -%}
{% set known_tid_storage_identifier_dict = {} -%}
{% set default_zodb_path = buildout_directory ~ '/srv/zodb' -%}
{% set zodb_backup_path = buildout_directory ~ '/srv/backup/zodb' -%}
{% set default_tidstorage_timestamp_path = buildout_directory ~ '/srv/backup/tidstorage' -%}
{% 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 tidstorage_ip = ipv4 -%}
{% set tidstorage_port = 6001 -%}
{% set bin_directory = parameter_dict['buildout-bin-directory'] -%}
[zeo-base]
recipe = slapos.cookbook:zeo
log-path = ${directory:log}/${:base-name}.log
pid-path = ${directory:run}/${:base-name}.pid
conf-path = ${directory:etc}/${:base-name}.conf
wrapper-path = ${directory:services}/${:base-name}
binary-path = {{ bin_directory }}/runzeo
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 -%}
{% for export_id, mountpoint_dict in slapparameter_dict['zodb-dict'].items() -%}
{% do storage_dict.setdefault(
mountpoint_dict.get('storage-family', 'default'), []
).append((
export_id,
mountpoint_dict.get('mount-point', '/'),
mountpoint_dict.get('cache-size', -1),
mountpoint_dict.get('storage-dict', {}),
)) -%}
{% endfor -%}
{% for storage_family, export_list in storage_dict.items() -%}
{% set known_tid_storage_identifier_host = (ipv4, local_current_port) -%}
{% set client_dict = {} -%}
{% for export_id, mount_point, cache_size, storage_dict in export_list -%}
{% do storage_dict.__setitem__('path', storage_dict.get('path', '%(zodb)s/' ~ export_id ~ '.fs') % {'zodb': default_zodb_path}) -%}
{% do client_dict.update(storage_dict.get('client', {})) -%}
{% do client_dict.__setitem__('storage', export_id) -%}
{# XXX: I would like to raise if export_id is present in zodb_dict -#}
{% do zodb_dict.__setitem__(export_id, [
mount_point,
cache_size,
client_dict,
]) -%}
{% if tidstorage_dict != None -%}
{% do known_tid_storage_identifier_dict.__setitem__(
(known_tid_storage_identifier_host, export_id), (
storage_dict['path'],
tidstorage_dict.get('zodb-dict', {}).get(export_id, '%(backup)s/' ~ export_id) % {'backup': zodb_backup_path},
mount_point,
),
) -%}
{% endif -%}
{% endfor -%}
{% set zeo_section_name = 'zeo-' ~ storage_family %}
[{{ zeo_section_name }}]
< = zeo-base
base-name = zeo-{{ storage_family }}
port = {{ next_port }}
{% set storage_list = [] -%}
{% for storage_name, _, _, storage_dict in export_list -%}
{% do storage_list.append((storage_name, storage_dict['path'])) -%}
{% endfor -%}
storage = {{ dumps(storage_list) }}
[{{ section(zeo_section_name ~ "-promise") }}]
recipe = slapos.cookbook:check_port_listening
hostname = {{ "${" ~ zeo_section_name ~ ":ip}" }}
port = {{ next_port }}
path = ${directory:promises}/zeo-{{ storage_family }}
{% if use_ipv6 -%}
{% do client_dict.__setitem__('server', '[' ~ 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 -%}
{% do client_dict.__setitem__('server', ipv4 ~ ':' ~ next_port) -%}
{% endif -%}
{% set next_port = next_port + 1 -%}
{% endfor -%}
{% if tidstorage_dict != None -%}
[tidstorage]
recipe = slapos.cookbook:tidstorage
known-tid-storage-identifier-dict = {{ dumps(known_tid_storage_identifier_dict) }}
configuration-path = ${directory:etc}/tidstorage.py
ip = {{ tidstorage_ip }}
port = {{ tidstorage_port }}
timestamp-file-path = {{ tidstorage_dict.get('timestamp-path', '%(backup)s/repozo_tidstorage_timestamp.log' % {'backup': default_tidstorage_timestamp_path}) }}
logfile-name = ${directory:log}/tidstorage.log
pidfile-name = ${directory:run}/tidstorage.pid
status-file = ${directory:tidstorage}/tidstorage.tid
tidstorage-repozo-binary = {{ bin_directory }}/tidstorage_repozo
tidstoraged-binary = {{ bin_directory }}/tidstoraged
repozo-binary = {{ bin_directory }}/repozo
tidstorage-wrapper = ${directory:services}/tidstoraged
repozo-wrapper = ${buildout:bin-directory}/tidstorage-repozo
[{{ section("promise-tidstorage") }}]
recipe = slapos.cookbook:check_port_listening
hostname = ${tidstorage:ip}
port = ${tidstorage:port}
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") }}]
# TODO:
# - configurable periodicity
# - configurable full/incremental
# - configurable retention
recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries}
name = tidstorage
frequency = 0 0 * * *
command = ${tidstorage:repozo-wrapper}
[{{ section("logrotate-tidstorage") }}]
recipe = slapos.cookbook:logrotate.d
logrotate-entries = ${logrotate:logrotate-entries}
backup = ${logrotate:backup}
name = tidstorage
log = ${tidstorage:logfile-name}
post = {{ bin_directory }}/killpidfromfile ${tidstorage:pidfile-name} SIGHUP
{% else -%}
[tidstorage]
ip =
port =
[tidstorage-tunnel]
ipv6 =
ipv6-port =
{% endif -%}
[publish]
recipe = slapos.cookbook:publish.serialised
zodb-storage-type = zeoclient
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-port = ${tidstorage:port}
{% endif -%}
[directory]
recipe = slapos.cookbook:mkdirectory
etc = ${buildout:directory}/etc
services = ${:etc}/run
promises = ${:etc}/promise
var = ${buildout:directory}/var
log = ${:var}/log
run = ${:var}/run
backup-zodb = {{ zodb_backup_path }}
zodb = {{ default_zodb_path }}
tidstorage = {{ default_tidstorage_timestamp_path }}
[buildout]
extends =
{{ parameter_dict['instance-logrotate-cfg'] }}
parts +=
{{ part_list | join('\n ') }}
publish
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
{% endif %}
...@@ -21,7 +21,7 @@ offline = true ...@@ -21,7 +21,7 @@ offline = true
{% if 'frontend-software-url' in slapparameter_dict -%} {% if 'frontend-software-url' in slapparameter_dict -%}
[request-slave-frontend] [request-slave-frontend]
recipe = slapos.cookbook:request.serialised recipe = slapos.cookbook:request
software-url = {{ slapparameter_dict['frontend-software-url'] }} software-url = {{ slapparameter_dict['frontend-software-url'] }}
software-type = {{ slapparameter_dict.get('frontend-software-type', 'RootSoftwareInstance') }} software-type = {{ slapparameter_dict.get('frontend-software-type', 'RootSoftwareInstance') }}
sla = instance_guid sla = instance_guid
...@@ -47,14 +47,14 @@ config-{{ name }} = {{ value }} ...@@ -47,14 +47,14 @@ config-{{ name }} = {{ value }}
return = site_url return = site_url
[publish-apache-zope-backend-connection-string] [publish-apache-zope-backend-connection-string]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish
url = ${request-slave-frontend:connection-site_url} url = ${request-slave-frontend:connection-site_url}
login = ${zope-instance:user} login = ${zope-instance:user}
password = ${zope-instance:password} password = ${zope-instance:password}
url-deadlock = ${:url}/${zope-instance:deadlock-path}?${zope-instance:deadlock-password} url-deadlock = ${:url}/${zope-instance:deadlock-path}?${zope-instance:deadlock-password}
{% else %} {% else %}
[publish-apache-zope-backend-connection-string] [publish-apache-zope-backend-connection-string]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish
url = https://${zope-instance:user}:${zope-instance:password}@[${apache-zope-backend-instance:ip}]:${apache-zope-backend-instance:port} url = https://${zope-instance:user}:${zope-instance:password}@[${apache-zope-backend-instance:ip}]:${apache-zope-backend-instance:port}
url-deadlock = ${:url}/${zope-instance:deadlock-path}?${zope-instance:deadlock-password} url-deadlock = ${:url}/${zope-instance:deadlock-path}?${zope-instance:deadlock-password}
{% endif %} {% endif %}
......
...@@ -6,8 +6,8 @@ eggs-directory = {{ eggs_directory }} ...@@ -6,8 +6,8 @@ eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }} develop-eggs-directory = {{ develop_eggs_directory }}
offline = true offline = true
[slap-configuration] [slap-parameters]
recipe = slapos.cookbook:slapconfiguration.serialised recipe = slapos.cookbook:slapconfiguration
computer = ${slap-connection:computer-id} computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id} partition = ${slap-connection:partition-id}
url = ${slap-connection:server-url} url = ${slap-connection:server-url}
...@@ -19,15 +19,53 @@ recipe = slapos.recipe.template:jinja2 ...@@ -19,15 +19,53 @@ recipe = slapos.recipe.template:jinja2
rendered = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename} rendered = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
extra-context = extra-context =
context = context =
key ipv4_set slap-configuration:ipv4
key ipv6_set slap-configuration:ipv6
key eggs_directory buildout:eggs-directory key eggs_directory buildout:eggs-directory
key develop_eggs_directory buildout:develop-eggs-directory key develop_eggs_directory buildout:develop-eggs-directory
key slap_software_type slap-configuration:slap-software-type key slap_software_type slap-parameters:slap-software-type
key slapparameter_dict slap-configuration:configuration key slapparameter_dict slap-parameters:configuration
key computer_id slap-configuration:computer
${:extra-context} ${:extra-context}
[dynamic-template-tidstorage-parameters]
apache = {{ apache_location }}
haproxy = {{ haproxy_location }}
dcron = {{ dcron_location }}
logrotate = {{ logrotate_location }}
gzip = {{ gzip_location }}
openssl = {{ openssl_location }}
coreutils = {{ coreutils_location }}
git = {{ git_location }}
graphviz = {{ graphviz_location }}
grep = {{ grep_location }}
imagemagick = {{ imagemagick_location }}
librsvg = {{ librsvg_location }}
mariadb = {{ mariadb_location }}
pdftk = {{ pdftk_location }}
sed = {{ sed_location }}
tesseract = {{ tesseract_location }}
w3m = {{ w3m_location }}
aspell = {{ aspell_location }}
poppler = {{ poppler_location }}
dmtx-utils = {{ dmtx_utils_location }}
buildout-bin-directory = {{ buildout_bin_directory }}
zope-conf-template = {{ template_zope_conf }}
[dynamic-template-tidstorage]
< = jinja2-template-base
template = {{ template_tidstorage }}
filename = instance-tidstorage.cfg
extensions = jinja2.ext.do
extra-context =
section parameter_dict dynamic-template-tidstorage-parameters
import json_module json
raw zope_port_base 12000
raw zeo_port_base 15000
raw haproxy_port_base 11000
raw apache_port_base 10000
key ipv4_set slap-parameters:ipv4
key ipv6_set slap-parameters:ipv6
# Must match the key id in [switch-softwaretype] which uses this section.
raw software_type tidstorage
[dynamic-template-cloudooo-parameters] [dynamic-template-cloudooo-parameters]
file = {{ file_location }} file = {{ file_location }}
fontconfig = {{ fontconfig_location }} fontconfig = {{ fontconfig_location }}
...@@ -45,8 +83,6 @@ zlib = {{ zlib_location }} ...@@ -45,8 +83,6 @@ zlib = {{ zlib_location }}
libreoffice-bin = {{ libreoffice_bin_location }} libreoffice-bin = {{ libreoffice_bin_location }}
fonts = {{ fonts_location }} fonts = {{ fonts_location }}
buildout-bin-directory = {{ buildout_bin_directory }} buildout-bin-directory = {{ buildout_bin_directory }}
6tunnel = {{ sixtunnel_location }}
dash = {{ dash_location }}
[dynamic-template-cloudooo] [dynamic-template-cloudooo]
< = jinja2-template-base < = jinja2-template-base
...@@ -151,150 +187,37 @@ extra-context = ...@@ -151,150 +187,37 @@ extra-context =
key template_zope dynamic-template-zope:rendered key template_zope dynamic-template-zope:rendered
key local_bt5_repository template-erp5-single-parameters:local_bt5_repository key local_bt5_repository template-erp5-single-parameters:local_bt5_repository
[dynamic-template-cluster-erp5-parameters] [dynamic-template-cluster-parameters]
local-bt5-repository = {{ local_bt5_repository }} local-bt5-repository = {{ local_bt5_repository }}
[dynamic-template-cluster-erp5] [dynamic-template-cluster]
< = jinja2-template-base < = jinja2-template-base
template = {{ template_erp5_cluster }} template = {{ template_erp5_cluster }}
filename = instance-cluster-erp5.cfg filename = instance-erp5-cluster.cfg
extensions = jinja2.ext.do
extra-context = extra-context =
key local_bt5_repository dynamic-template-cluster-erp5-parameters:local-bt5-repository key local_bt5_repository dynamic-template-cluster-parameters:local-bt5-repository
# Must match the key id in [switch-softwaretype] which uses this section. # Must match the key id in [switch-softwaretype] which uses this section.
raw software_type cluster # XXX: it is dangerous to use buildout-style expansion in jinja context declaration
raw software_type ${:software-type}
software-type = cluster
[dynamic-template-balancer-parameters] # BBB: use "cluster" software type instead
apache = {{ apache_location }} [dynamic-template-production]
openssl = {{ openssl_location }} < = dynamic-template-cluster
haproxy = {{ haproxy_location }} software-type = production
instance-logrotate-cfg = {{ template_logrotate_base }}
bin-directory = {{ bin_directory }}
6tunnel = {{ sixtunnel_location }}
dash = {{ dash_location }}
[dynamic-template-balancer]
< = jinja2-template-base
template = {{ template_balancer }}
extensions = jinja2.ext.do
filename = instance-balancer.cfg
extra-context =
section parameter_dict dynamic-template-balancer-parameters
# Must match the key id in [switch-softwaretype] which uses this section.
raw software_type balancer
[dynamic-template-zeo-parameters]
buildout-bin-directory = {{ buildout_bin_directory }}
instance-logrotate-cfg = {{ template_logrotate_base }}
6tunnel = {{ sixtunnel_location }}
dash = {{ dash_location }}
[dynamic-template-zeo]
< = jinja2-template-base
template = {{ template_zeo }}
filename = instance-zeo.cfg
extensions = jinja2.ext.do
extra-context =
key buildout_directory buildout:directory
section parameter_dict dynamic-template-zeo-parameters
# Must match the key id in [switch-softwaretype] which uses this section.
raw software_type zodb-zeo
[dynamic-template-cluster-zope-parameters]
zope-conf-template = {{ template_zope_conf }}
instance-logrotate-cfg = {{ template_logrotate_base }}
git = {{ git_location }}
graphviz = {{ graphviz_location }}
buildout-bin-directory = {{ buildout_bin_directory }}
coreutils = {{ coreutils_location }}
grep = {{ grep_location }}
imagemagick = {{ imagemagick_location }}
pdftk = {{ pdftk_location }}
sed = {{ sed_location }}
tesseract = {{ tesseract_location }}
w3m = {{ w3m_location }}
poppler = {{ poppler_location }}
dmtx-utils = {{ dmtx_utils_location }}
openssl = {{ openssl_location }}
6tunnel = {{ sixtunnel_location }}
dash = {{ dash_location }}
[dynamic-template-cluster-zope]
< = jinja2-template-base
template = {{ template_cluster_zope }}
filename = instance-cluster-zope.cfg
extensions = jinja2.ext.do
extra-context =
key buildout_directory buildout:directory
section parameter_dict dynamic-template-cluster-zope-parameters
# Must match the key id in [switch-softwaretype] which uses this section.
raw software_type cluster-zope
[dynamic-template-kumofs-parameters]
dash-location = {{ dash_location }}
dcron-location = {{ dcron_location }}
gzip-location = {{ gzip_location }}
kumo-location = {{ kumo_location }}
logrotate-location = {{ logrotate_location }}
[dynamic-template-kumofs]
< = jinja2-template-base
template = {{ template_kumofs }}
filename = instance-kumofs.cfg
extra-context =
section parameter_dict dynamic-template-kumofs-parameters
# Must match the key id in [switch-softwaretype] which uses this section.
raw software_type kumofs
[dynamic-template-mariadb-parameters]
coreutils-location = {{ coreutils_location }}
dcron-location = {{ dcron_location }}
gettext-location = {{ gettext_location }}
grep-location = {{ grep_location }}
gzip-location = {{ gzip_location }}
logrotate-location = {{ logrotate_location }}
mariadb-location = {{ mariadb_location }}
perl-location = {{ perl_location }}
perl-siteprefix = {{ perl_siteprefix }}
sed-location = {{ sed_location }}
xtrabackup-location = {{ xtrabackup_location }}
[dynamic-template-mariadb]
< = jinja2-template-base
template = {{ template_mariadb }}
filename = instance-mariadb.cfg
extra-context =
section parameter_dict dynamic-template-mariadb-parameters
# Must match the key id in [switch-softwaretype] which uses this section.
raw software_type mariadb
[dynamic-template-memcached-parameters]
dash-location = {{ dash_location }}
6tunnel-location = {{ sixtunnel_location }}
memcached-location = {{ memcached_location }}
[dynamic-template-memcached]
< = jinja2-template-base
template = {{ template_memcached }}
filename = instance-memcached.cfg
extra-context =
section parameter_dict dynamic-template-memcached-parameters
# Must match the key id in [switch-softwaretype] which uses this section.
raw software_type memcached
[switch-softwaretype] [switch-softwaretype]
recipe = slapos.cookbook:softwaretype recipe = slapos.cookbook:softwaretype
default = ${template-erp5-single:rendered} default = ${template-erp5-single:rendered}
cluster = ${dynamic-template-cluster-erp5:rendered} production = ${dynamic-template-production:rendered}
kumofs = ${dynamic-template-kumofs:rendered} cluster = ${dynamic-template-cluster:rendered}
memcached = ${dynamic-template-memcached:rendered} kumofs = {{ template_kumofs }}
memcached = {{ template_memcached }}
cloudooo = ${dynamic-template-cloudooo:rendered} cloudooo = ${dynamic-template-cloudooo:rendered}
zope = ${dynamic-template-zope:rendered} zope = ${dynamic-template-zope:rendered}
mariadb = ${dynamic-template-mariadb:rendered} mariadb = {{ template_mariadb }}
tidstorage = ${dynamic-template-tidstorage:rendered}
varnish = ${dynamic-template-varnish:rendered} varnish = ${dynamic-template-varnish:rendered}
balancer = ${dynamic-template-balancer:rendered}
zodb-zeo = ${dynamic-template-zeo:rendered}
cluster-zope = ${dynamic-template-cluster-zope:rendered}
[slap-connection] [slap-connection]
# part to migrate to new - separated words # part to migrate to new - separated words
......
...@@ -43,7 +43,7 @@ products {{ instance_products }} ...@@ -43,7 +43,7 @@ products {{ instance_products }}
</product-config> </product-config>
{% endif -%} {% endif -%}
{% set timerserver_interval = parameter_dict.get('timerserver-interval', 0) -%} {% set timerserver_interval = parameter_dict.get('timerserver-interval', '0') | int -%}
{% if timerserver_interval -%} {% if timerserver_interval -%}
%import timerserver %import timerserver
<timer-server> <timer-server>
...@@ -83,7 +83,7 @@ products {{ instance_products }} ...@@ -83,7 +83,7 @@ products {{ instance_products }}
{% for db_name, mount_point, cache_size, storage_type, storage_dict in parameter_dict['zodb-list'] -%} {% for db_name, mount_point, cache_size, storage_type, storage_dict in parameter_dict['zodb-list'] -%}
<zodb_db {{ db_name }}> <zodb_db {{ db_name }}>
{%- if cache_size >= 0 %} {%- if cache_size %}
cache-size {{ cache_size }} cache-size {{ cache_size }}
{%- endif %} {%- endif %}
mount-point {{ mount_point }} mount-point {{ mount_point }}
......
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