Commit 1d65ee00 authored by Łukasz Nowak's avatar Łukasz Nowak

software/rapid-cdn: Switch to CDN specific parameter

Parameters like "slave instance list" are very similar to SlapOS Master
reserved slave_instance_list (and slapos.cookbook:slapconfiguration
slave-instance-list) and using them leads to confusion so instead prepare
to use CDN specific frontend-list as the parameter name which shall be passed.

extra_slave_instance_list is still sent as is, in order to being able to drop
it in future iterations of deployed clusters, the new parameter comes in for
future compatbility, and frontend-list is already used and understood by the
instance-slave-list.cfg.in
parent 5c627aad
......@@ -26,11 +26,11 @@ md5sum = 11c152cb4a23814051eed6d6bb836c00
[profile-master]
filename = instance-master.cfg.in
md5sum = 877e08db0fb814882f716a9cd0429c83
md5sum = e161e544c64ace05eb4d2306d604153f
[profile-slave-list]
filename = instance-slave-list.cfg.in
md5sum = 1c40e4b756503c34edca47c9f46f0f5c
md5sum = 5ce5113f9fa2e6e7d393b4ae8fb10dcd
[profile-master-publish-slave-information]
filename = instance-master-publish-slave-information.cfg.in
......
......@@ -122,7 +122,6 @@ context =
{% set single_type_key = 'single-' %}
{% set frontend_type = "%s%s" % (single_type_key, 'custom-personal') %}
{% set frontend_quantity = instance_parameter_dict['configuration'].pop('-frontend-quantity', '1') | int %}
{% set slave_list_name = 'extra_slave_instance_list' %}
{% set frontend_list = [] %}
{% set frontend_section_list = [] %}
{% set request_dict = {} %}
......@@ -419,7 +418,8 @@ config-cluster-identification = {{ instance_parameter_dict['root-instance-title'
{% set node_configuration_dict = {} %}
{% do node_configuration_dict.update(frontend_request.get('config')) %}
{# sort_keys are important in order to avoid shuffling parameters on each run #}
{% do node_configuration_dict.__setitem__(slave_list_name, json_module.dumps(authorized_slave_list, sort_keys=True)) %}
{% do node_configuration_dict.__setitem__("frontend-list", json_module.dumps([])) %} {# XXX Upward compatbility #}
{% do node_configuration_dict.__setitem__("extra_slave_instance_list", json_module.dumps(authorized_slave_list, sort_keys=True)) %} {# XXX Backward compatibility #}
{% do node_configuration_dict.__setitem__("frontend-name", frontend_request.get('name')) %}
{%- for config_key, config_value in node_configuration_dict.items() %}
config-{{ config_key }} = {{ dumps(config_value) }}
......
......@@ -13,9 +13,8 @@
{%- set slave_log_dict = {} %}
{%- set slave_instance_information_list = [] %}
{%- set slave_instance_list = instance_parameter_dict['slave-instance-list'] %}
{%- if configuration['extra_slave_instance_list'] %}
{%- do slave_instance_list.extend(json_module.loads(configuration['extra_slave_instance_list'])) %}
{%- endif %}
{%- set frontend_list = json_module.loads(configuration['frontend-list']) %} {#- XXX Upward compatibility #}
{%- do frontend_list.extend(json_module.loads(configuration.get('extra_slave_instance_list', []))) %} {#- XXX Backward compatibility #}
{%- if master_key_download_url %}
{%- do kedifa_updater_mapping.append((master_key_download_url, frontend_haproxy_configuration['master-certificate'], apache_certificate)) %}
{%- else %}
......@@ -427,10 +426,8 @@ hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
{#- Publish information for the instance #}
[publish]
recipe = slapos.cookbook:publish.serialised
{%- if configuration['extra_slave_instance_list'] %}
{#- sort_keys are important in order to avoid shuffling parameters on each run #}
slave-instance-information-list = {{ json_module.dumps(slave_instance_information_list, sort_keys=True) }}
{%- endif %}
monitor-base-url = {{ monitor_base_url }}
kedifa-csr-url = ${expose-csr:url}/${expose-csr-link-csr-kedifa:filename}
backend-client-csr-url = ${expose-csr:url}/${expose-csr-link-csr-backend-haproxy:filename}
......
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