Commit db56d052 authored by Tatuya Kamada's avatar Tatuya Kamada

erp5: Add dynamic apache config template for balancer.

parent 0e946d70
...@@ -74,7 +74,7 @@ md5sum = d41d8cd98f00b204e9800998ecf8427e ...@@ -74,7 +74,7 @@ md5sum = d41d8cd98f00b204e9800998ecf8427e
[template-erp5] [template-erp5]
filename = instance-erp5.cfg.in filename = instance-erp5.cfg.in
md5sum = 37f43c57353e0fa5f15f36846a45da8a md5sum = d6e98e66dbff9077d6d8e6d3ea23e48a
[template-zeo] [template-zeo]
filename = instance-zeo.cfg.in filename = instance-zeo.cfg.in
...@@ -86,7 +86,7 @@ md5sum = 7415a758c1076888d675aca1d9440b22 ...@@ -86,7 +86,7 @@ md5sum = 7415a758c1076888d675aca1d9440b22
[template-balancer] [template-balancer]
filename = instance-balancer.cfg.in filename = instance-balancer.cfg.in
md5sum = f0fd49c7d6d9f7c6936afba0d18b7691 md5sum = a4caf55109bd12740e4f29c3931776b1
[template-haproxy-cfg] [template-haproxy-cfg]
filename = haproxy.cfg.in filename = haproxy.cfg.in
......
...@@ -21,6 +21,12 @@ per partition. No more (undefined result), no less (IndexError). ...@@ -21,6 +21,12 @@ per partition. No more (undefined result), no less (IndexError).
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
mode = 644 mode = 644
{% if slapparameter_dict.get('custom-template-apache-conf', {}) -%}
{% set apache_conf_template = slapparameter_dict['custom-template-apache-conf'] -%}
{% else -%}
{% set apache_conf_template = parameter_dict['template-apache-conf'] -%}
{% endif -%}
[simplefile] [simplefile]
< = jinja2-template-base < = jinja2-template-base
template = inline:{{ '{{ content }}' }} template = inline:{{ '{{ content }}' }}
...@@ -213,7 +219,7 @@ crl = ${apache-ssl-client:crl} ...@@ -213,7 +219,7 @@ crl = ${apache-ssl-client:crl}
[apache-conf] [apache-conf]
< = jinja2-template-base < = jinja2-template-base
template = {{ parameter_dict['template-apache-conf'] }} template = {{ dumps(apache_conf_template) }}
rendered = ${directory:apache-conf}/apache.conf rendered = ${directory:apache-conf}/apache.conf
context = section parameter_dict apache-conf-parameter-dict context = section parameter_dict apache-conf-parameter-dict
......
...@@ -267,6 +267,7 @@ config-{{ name }}-test-runner-address-list = {{ ' ${' ~ zope_section_id ~ ':conn ...@@ -267,6 +267,7 @@ config-{{ name }}-test-runner-address-list = {{ ' ${' ~ zope_section_id ~ ':conn
# XXX: should those really be same for all families ? # XXX: should those really be same for all families ?
config-haproxy-server-check-path = {{ dumps(balancer_dict.get('haproxy-server-check-path', '/') % {'site-id': site_id}) }} config-haproxy-server-check-path = {{ dumps(balancer_dict.get('haproxy-server-check-path', '/') % {'site-id': site_id}) }}
config-ssl = {{ dumps(balancer_dict.get('ssl', {})) }} config-ssl = {{ dumps(balancer_dict.get('ssl', {})) }}
config-custom-template-apache-conf = {{ dumps(balancer_dict.get('custom-template-apache-conf', {})) }}
config-monitor-passwd = ${monitor-htpasswd:passwd} config-monitor-passwd = ${monitor-htpasswd:passwd}
config-name = ${:name} config-name = ${:name}
config-caucase-url = ${request-caucase:connection-http-url} config-caucase-url = ${request-caucase:connection-http-url}
......
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