Commit a6ff30d5 authored by Łukasz Nowak's avatar Łukasz Nowak

caddy-frontend: Allow to override parameters

As there is some kind of "collision" with request, allow to override
parameters.

Treat `<key>` as default and overwrite it with `frontend-config-<num>-<key>`,
instead of having the global `<key>` always passed to slaves.

This allows to request the partition with:

  monitor-httpd-frontend=12345
  -frontend-config-1-monitor-httpd-frontend=9876
  -frontend-config-1-monitor-httpd-frontend=8765
parent e8c30c6e
......@@ -23,7 +23,7 @@ md5sum = 91330ba52f166341f99a4a1a868e6e7f
[template-apache-replicate]
filename = instance-apache-replicate.cfg.in
md5sum = a30d4bc21ae94d0eca42cea5032468a8
md5sum = b609039168770aa17599838018180d80
[template-slave-list]
filename = templates/apache-custom-slave-list.cfg.in
......
......@@ -100,8 +100,8 @@ name = {{ frontend_request.get('name') }}
{% if frontend_request.get('state') %}
state = {{ frontend_request.get('state') }}
{% endif%}
{% set slave_configuration_dict = frontend_request.get('config') %}
{% do slave_configuration_dict.update(**slapparameter_dict) %}
{% set slave_configuration_dict = slapparameter_dict %}
{% do slave_configuration_dict.update(**frontend_request.get('config')) %}
{% do slave_configuration_dict.__setitem__(slave_list_name, json_module.dumps(authorized_slave_list)) %}
{% do slave_configuration_dict.__setitem__("frontend-name", frontend_request.get('name')) %}
config-_ = {{ json_module.dumps(slave_configuration_dict) }}
......
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