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