Commit 0ef07438 authored by Vincent Pelletier's avatar Vincent Pelletier

stack.erp5: Stop using slapos.cookbook:generic.zope.zeo.client .

Such complex recipes prevent evolution. Split it into individual
components already covered by existing recipes.
parent 951f2f89
...@@ -184,10 +184,10 @@ md5sum = 5691b7f12d22bfb8a926dfcb592f12c8 ...@@ -184,10 +184,10 @@ md5sum = 5691b7f12d22bfb8a926dfcb592f12c8
filename = zope.conf.in filename = zope.conf.in
md5sum = 77ab4f229a92e02603028a0bd3772edd md5sum = 77ab4f229a92e02603028a0bd3772edd
[template-runzope-userhosts-preloaded] [site-zcml]
<= download-base <= download-base
filename = runzope_userhosts_preloaded.in filename = site.zcml
md5sum = bc6048b85b410693e60e5a77399dd1b7 md5sum = d32417746fcf671d4e86a70379815039
[template-my-cnf] [template-my-cnf]
<= download-base <= download-base
...@@ -234,7 +234,7 @@ recipe = slapos.recipe.template:jinja2 ...@@ -234,7 +234,7 @@ recipe = slapos.recipe.template:jinja2
# XXX: "template.cfg" is hardcoded in instanciation recipe # XXX: "template.cfg" is hardcoded in instanciation recipe
rendered = ${buildout:directory}/template.cfg rendered = ${buildout:directory}/template.cfg
template = ${:_profile_base_location_}/instance.cfg.in template = ${:_profile_base_location_}/instance.cfg.in
md5sum = 10d02ec69c875e6a55afe3bf79db7bba md5sum = 83aaa4def66c5667049c1fd025949125
mode = 640 mode = 640
context = context =
key mariadb_link_binary template-mariadb:link-binary key mariadb_link_binary template-mariadb:link-binary
...@@ -288,6 +288,7 @@ context = ...@@ -288,6 +288,7 @@ context =
key pixman_location pixman:location key pixman_location pixman:location
key postfix_location postfix:location key postfix_location postfix:location
key root_common root-common:target key root_common root-common:target
key site_zcml site-zcml:target
key sixtunnel_location 6tunnel:location key sixtunnel_location 6tunnel:location
key slapos_core_version versions:slapos.core key slapos_core_version versions:slapos.core
key stunnel_location stunnel:location key stunnel_location stunnel:location
...@@ -308,7 +309,6 @@ context = ...@@ -308,7 +309,6 @@ context =
key template_postfix_aliases template-postfix-aliases:target key template_postfix_aliases template-postfix-aliases:target
key template_postfix_main_cf template-postfix-main-cf:target key template_postfix_main_cf template-postfix-main-cf:target
key template_postfix_master_cf template-postfix-master-cf:target key template_postfix_master_cf template-postfix-master-cf:target
key template_runzope_userhosts_preloaded template-runzope-userhosts-preloaded:target
key template_zeo template-zeo: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
...@@ -341,7 +341,7 @@ md5sum = b0cb0ee97cddc79112a718e065806037 ...@@ -341,7 +341,7 @@ md5sum = b0cb0ee97cddc79112a718e065806037
[template-zope] [template-zope]
<= download-base <= download-base
filename = instance-zope.cfg.in filename = instance-zope.cfg.in
md5sum = 83304f1940e0d7555bd678e2cea4c738 md5sum = c42bb374f41654433fb9470c1d4e4483
link-binary = link-binary =
${aspell:location}/bin/aspell ${aspell:location}/bin/aspell
${dmtx-utils:location}/bin/dmtxwrite ${dmtx-utils:location}/bin/dmtxwrite
......
...@@ -162,20 +162,6 @@ template = inline: {{ ' ...@@ -162,20 +162,6 @@ template = inline: {{ '
rendered = ${directory:etc}/hosts rendered = ${directory:etc}/hosts
context = key host_dict hosts-parameter:host-dict context = key host_dict hosts-parameter:host-dict
[preload-userhosts-runzope-parameter]
runzope-binary = {{ bin_directory }}/runzope
userhosts = {{ parameter_dict['userhosts'] }}
shell-path = {{ parameter_dict['dash'] }}/bin/dash
hosts = ${hosts:rendered}
hostaliases = ${hostaliases:rendered}
[preload-userhosts-runzope]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:bin}/runzope_userhosts_preloaded
context = section parameter_dict preload-userhosts-runzope-parameter
template = {{ parameter_dict['runzope-userhosts-preloaded-template'] }}
mode = 755
{# Hack to deploy SSL certs via instance parameters -#} {# Hack to deploy SSL certs via instance parameters -#}
{% for zodb in zodb_dict.itervalues() -%} {% for zodb in zodb_dict.itervalues() -%}
{% set storage_dict = zodb.setdefault('storage-dict', {}) -%} {% set storage_dict = zodb.setdefault('storage-dict', {}) -%}
...@@ -197,19 +183,31 @@ pem = {{dumps(storage_dict.pop(k))}} ...@@ -197,19 +183,31 @@ pem = {{dumps(storage_dict.pop(k))}}
{% endfor -%} {% endfor -%}
{# endhack -#} {# endhack -#}
[zope-base] [runzope-base]
recipe = slapos.cookbook:generic.zope.zeo.client recipe = slapos.cookbook:wrapper
inituser = ${directory:instance}/inituser environment =
user = {{ dumps(slapparameter_dict['inituser-login']) }} HOSTALIASES=${hostaliases:rendered}
password = {{ dumps(slapparameter_dict['inituser-password']) }} HOSTS=${hosts:rendered}
timezone = {{ dumps(slapparameter_dict['timezone']) }} TMP=${directory:tmp}
tmp-path = ${directory:tmp} TMPDIR=${directory:tmp}
instancehome-path = ${directory:instance} HOME=${buildout:directory}
home-path = ${buildout:directory} PATH=${directory:bin}:{{ parameter_dict['coreutils'] }}/bin
bin-path = ${directory:bin}:{{ parameter_dict['coreutils'] }}/bin TZ={{ slapparameter_dict['timezone'] }}
site-zcml = ${directory:instance-etc}/site.zcml INSTANCE_HOME=${directory:instance}
runzope-binary = ${preload-userhosts-runzope:rendered} parameters-extra = true
bt5-repository = command-line = '{{ parameter_dict['userhosts'] }}' '{{ bin_directory }}/runzope' -C '${:configuration-file}'
[{{ section('zcml') }}]
recipe = slapos.cookbook:symbolic.link
target-directory = ${directory:instance-etc}
link-binary = {{ parameter_dict['site-zcml'] }}
[{{ section('zope-inituser') }}]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:instance}/inituser
template = inline:{{ slapparameter_dict['inituser-login'] }}:{SHA}{{ hashlib.sha1(slapparameter_dict['inituser-password']).digest().encode('base64').rstrip() }}
mode = 600
once = ${:rendered}_done
[zope-conf-parameter-base] [zope-conf-parameter-base]
ip = {{ ipv4 }} ip = {{ ipv4 }}
...@@ -309,8 +307,8 @@ context = ...@@ -309,8 +307,8 @@ context =
section parameter_dict {{ conf_parameter_name }} section parameter_dict {{ conf_parameter_name }}
[{{ section(name) }}] [{{ section(name) }}]
< = zope-base < = runzope-base
wrapper = ${directory:service-on-watch}/{{ name }} wrapper-path = ${directory:service-on-watch}/{{ name }}
configuration-file = {{ '${' ~ conf_name ~ ':rendered}' }} configuration-file = {{ '${' ~ conf_name ~ ':rendered}' }}
[{{ section("promise-" ~ name) }}] [{{ section("promise-" ~ name) }}]
......
...@@ -122,7 +122,7 @@ dash = {{ dash_location }} ...@@ -122,7 +122,7 @@ dash = {{ dash_location }}
jsl = {{ jsl_location }} jsl = {{ jsl_location }}
link-binary = {{ dumps(zope_link_binary) }} link-binary = {{ dumps(zope_link_binary) }}
userhosts = {{ userhosts_location }} userhosts = {{ userhosts_location }}
runzope-userhosts-preloaded-template = {{ template_runzope_userhosts_preloaded }} site-zcml = {{ site_zcml }}
template-monitor = {{ dumps(template_monitor) }} template-monitor = {{ dumps(template_monitor) }}
extra-path-list = {{ dumps(extra_path_list) }} extra-path-list = {{ dumps(extra_path_list) }}
...@@ -134,6 +134,7 @@ extra-context = ...@@ -134,6 +134,7 @@ extra-context =
key buildout_directory buildout:directory key buildout_directory buildout:directory
section parameter_dict dynamic-template-zope-parameters section parameter_dict dynamic-template-zope-parameters
import urlparse urlparse import urlparse urlparse
import hashlib hashlib
[dynamic-template-kumofs-parameters] [dynamic-template-kumofs-parameters]
dash-location = {{ dash_location }} dash-location = {{ dash_location }}
......
#!{{ parameter_dict['shell-path'] }}
HOSTALIASES='{{ parameter_dict['hostaliases'] }}' HOSTS='{{ parameter_dict['hosts'] }}' exec '{{ parameter_dict['userhosts'] }}' '{{ parameter_dict['runzope-binary'] }}' "$@"
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:meta="http://namespaces.zope.org/meta"
xmlns:five="http://namespaces.zope.org/five">
<include package="Products.Five" />
<meta:redefinePermission from="zope2.Public" to="zope.Public" />
<!-- Load the meta -->
<include files="package-includes/*-meta.zcml" />
<five:loadProducts file="meta.zcml"/>
<!-- Load the configuration -->
<include files="package-includes/*-configure.zcml" />
<five:loadProducts />
<!-- Load the configuration overrides-->
<includeOverrides files="package-includes/*-overrides.zcml" />
<five:loadProductsOverrides />
<securityPolicy
component="Products.Five.security.FiveSecurityPolicy" />
</configure>
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