Commit 4d971eaa authored by Jérome Perrin's avatar Jérome Perrin

stack/erp5: re-implement zeo config file and wrapper generation inline

this logic was simple enough to be inlined and this makes it easier to
make changes
parent ed6531df
......@@ -226,6 +226,7 @@ context =
key template_postfix_master_cf template-postfix-master-cf:target
key instance_wcfs_cfg_in instance-wcfs.cfg.in:target
key template_zeo template-zeo:target
key template_zeo_conf template-zeo-conf:target
key template_zodb_base template-zodb-base:target
key template_zope template-zope:target
key template_zope_conf template-zope-conf:target
......@@ -245,6 +246,9 @@ context =
[template-zeo]
<= download-base
[template-zeo-conf]
<= download-base
[template-zodb-base]
<= download-base
......
......@@ -70,7 +70,7 @@ md5sum = b95084ae9eed95a68eada45e28ef0c04
[template]
filename = instance.cfg.in
md5sum = ca0cb83950dd9079cc289891cce08e76
md5sum = b15425c6e37314c499ad4c0dd52a8212
[template-erp5]
filename = instance-erp5.cfg.in
......@@ -78,7 +78,11 @@ md5sum = d6f7d2fa1bde019892897c767f93e089
[template-zeo]
filename = instance-zeo.cfg.in
md5sum = a9d42d8b2aee3c329913d46e0e3cd108
md5sum = cfc3a6a9ce54415b57b9f935524c0d41
[template-zeo-conf]
filename = zeo.conf.in
md5sum = 9e15886206c5deda35542c98acb42e70
[template-zodb-base]
filename = instance-zodb-base.cfg.in
......
......@@ -8,14 +8,6 @@
{% set default_backup_path = buildout_directory ~ '/srv/backup/zodb' -%}
{% 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 }}
{% set known_tid_storage_identifier_dict = {} -%}
{% set zodb_dict = {} -%}
......@@ -41,12 +33,30 @@ ip = {{ ipv4 }}
{% endfor -%}
{% set zeo_section_name = 'zeo-' ~ family %}
[{{ zeo_section_name }}]
< = zeo-base
[{{ zeo_section_name ~ "-base" }}]
base-name = zeo-{{ family }}
log-path = ${directory:log}/${:base-name}.log
pid-path = ${directory:run}/${:base-name}.pid
ip = {{ ipv4 }}
port = {{ current_port }}
storage = {{ dumps(storage_list) }}
[{{ zeo_section_name ~ "-conf" }}]
<= {{ zeo_section_name ~ "-base" }}
recipe = slapos.recipe.template:jinja2
url = {{ parameter_dict['zeo-conf-template'] }}
output = ${directory:etc}/${:base-name}.conf
context =
section parameter_dict ${:_buildout_section_name_}
[{{ zeo_section_name }}]
<= {{ zeo_section_name ~ "-base" }}
recipe = slapos.cookbook:wrapper
base-name = {{ "${" ~ zeo_section_name ~"-conf:base-name}" }}
log-path = {{ "${" ~ zeo_section_name ~"-conf:log-path}" }}
wrapper-path = ${directory:services}/${:base-name}
command-line = {{ bin_directory }}/runzeo -C {{ "${" ~ zeo_section_name ~"-conf:output}" }}
[{{ section("logrotate-" ~ zeo_section_name) }}]
< = logrotate-entry-base
name = {{ "${" ~ zeo_section_name ~ ":base-name}" }}
......
......@@ -102,6 +102,7 @@ import-list =
[dynamic-template-zeo-parameters]
<= default-dynamic-template-parameters
zeo-conf-template = {{ template_zeo_conf }}
[dynamic-template-zeo]
<= jinja2-template-base
......
<zeo>
address {{ parameter_dict['ip'] }}:{{ parameter_dict['port'] }}
pid-filename {{ parameter_dict['pid-path'] }}
</zeo>
{% for (storage_name, storage_path) in parameter_dict['storage'] -%}
<filestorage {{ storage_name }}>
path {{ storage_path }}
# pack-gc false
</filestorage>
{% endfor %}
<eventlog>
<logfile>
dateformat
path {{ parameter_dict['log-path'] }}
</logfile>
</eventlog>
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