Commit a9e6e1c0 authored by Tatuya Kamada's avatar Tatuya Kamada

erp5: Add dynamic balancer's apache config template.

parent a639e981
......@@ -296,7 +296,7 @@ extra-context =
[template-erp5]
< = download-base
filename = instance-erp5.cfg.in
md5sum = 4c552f915eb6549ce160a9ff5871ae74
md5sum = ff8ecdc258e2529b3979fd6596a27b95
[template-zeo]
< = download-base
......@@ -330,7 +330,7 @@ link-binary =
[template-balancer]
< = download-base
filename = instance-balancer.cfg.in
md5sum = 3628f0ba358e7ee96a8d0185c4775911
md5sum = 8f6e55a0972b086bed4e40d4f49608ca
[template-apache-conf]
< = download-base
......
......@@ -16,6 +16,12 @@ per partition. No more (undefined result), no less (IndexError).
{% do apache_ip_list.append('[' ~ ipv6 ~ ']') -%}
{% endif -%}
{% if slapparameter_dict.get('custom-template-apache-conf', None) -%}
{% set apache_conf_template = slapparameter_dict['custom-template-apache-conf'] -%}
{% else -%}
{% set apache_conf_template = parameter_dict['template-apache-conf'] -%}
{% endif -%}
[simplefile]
recipe = slapos.recipe.template:jinja2
template = inline:{{ '{{ content }}' }}
......@@ -134,7 +140,7 @@ crl = ${apache-ssl-client:crl}
[apache-conf]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_dict['template-apache-conf'] }}
template = {{ dumps(apache_conf_template) }}
rendered = ${directory:apache-conf}/apache.conf
context = section parameter_dict apache-conf-parameter-dict
......
......@@ -178,6 +178,7 @@ config-{{ name }} = {{ ' ${' ~ zope_section_id ~ ':connection-zope-address-list}
config-haproxy-server-check-path = {{ dumps(balancer_dict.get('haproxy-server-check-path', '/') % {'site-id': site_id}) }}
config-backend-path = {{ dumps(balancer_dict.get('apache-backend-path', '/') % {'site-id': site_id}) }}
config-ssl = {{ dumps(balancer_dict.get('ssl', {})) }}
config-custom-template-apache-conf = {{ dumps(balancer_dict.get('custom-template-apache-conf', None)) }}
[request-frontend-base]
{% if has_frontend -%}
......
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