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

XXX yet another experiment

parent 3b5e1d88
......@@ -22,7 +22,7 @@ md5sum = 5784bea3bd608913769ff9a8afcccb68
[profile-frontend]
filename = instance-frontend.cfg.in
md5sum = 0b53813165b1b796f44183863fa278ee
md5sum = a051d9f32c1ea2bf5b67f4012f772124
[profile-master]
filename = instance-master.cfg.in
......@@ -30,7 +30,7 @@ md5sum = 291f73c3782040d02fd56a46f61c201b
[profile-slave-list]
filename = instance-slave-list.cfg.in
md5sum = 8c5291a3f88c6fa2534c2e146cead39b
md5sum = e0e462bd94d2b468c88ff69c2156d0f5
[profile-master-publish-slave-information]
filename = instance-master-publish-slave-information.cfg.in
......
......@@ -357,59 +357,49 @@ stop-on-error = True
template_csr='${backend-client-login-csr:template-csr}'
)}}
[dynamic-custom-personal-profile-slave-list-config]
backend-client-caucase-url = {{ instance_parameter_dict['configuration']['backend-client-caucase-url'] }}
master-key-download-url = {{ dumps(instance_parameter_dict['configuration']['master-key-download-url']) }}
expose-csr-organization = {{ instance_parameter_dict['configuration']['cluster-identification'] }}
expose-csr-organizational-unit = {{ instance_parameter_dict['instance-title'] }}
url-ready-file = ${directory:var}/url-ready.txt
http3-enable = {{ dumps(FRONTEND_HTTP3) }}
global_ipv6 = ${slap-configuration:ipv6-random}
empty-template = ${software-release-path:template-empty}
template-expose-csr-nginx-conf = ${software-release-path:template-expose-csr-nginx-conf}
frontend-lazy-graceful-reload = ${frontend-haproxy-lazy-graceful:output}
monitor-base-url = ${monitor-instance-parameter:monitor-base-url}
node-id = ${frontend-node-id:value}
version-hash = ${version-hash:value}
software-release-url = ${version-hash:software-release-url}
node-information = ${frontend-node-information:value}
# BBB: SlapOS Master non-zero knowledge BEGIN
apache-certificate = ${certificate-chain:output}
# BBB: SlapOS Master non-zero knowledge END
custom-ssl-directory = ${frontend-directory:custom-ssl-directory}
## frontend haproxy
template-frontend-haproxy-configuration = ${software-release-path:template-frontend-haproxy-configuration}
template-frontend-haproxy-crt-list = ${software-release-path:template-frontend-haproxy-crt-list}
## backend haproxy
template-backend-haproxy-configuration = ${software-release-path:template-backend-haproxy-configuration}
[dynamic-custom-personal-profile-slave-list]
TODO NOTE:
* create configuration section
* avoid using DEFAULTS in the called level, provide everything what is needed
* use DEFAULTS on this level
* XXX: big change
< = jinja2-template-base
depends = ${software-py:recipe}
url = {{ software_parameter_dict['profile_slave_list'] }}
filename = instance-slave-list.cfg
master_key_download_url = {{ dumps(instance_parameter_dict['configuration']['master-key-download-url']) }}
software_type = single-custom-personal
organization = {{ instance_parameter_dict['configuration']['cluster-identification'] }}
organizational-unit = {{ instance_parameter_dict['instance-title'] }}
backend-client-caucase-url = {{ instance_parameter_dict['configuration']['backend-client-caucase-url'] }}
url-ready-file = ${directory:var}/url-ready.txt
http3-enable = {{ dumps(FRONTEND_HTTP3) }}
SLAVE_DEFAULTS = {{ dumps(SLAVE_DEFAULTS) }}
extra-context =
key backend_client_caucase_url :backend-client-caucase-url
import furl_module furl
import urllib_module urllib
import operator_module operator
key SLAVE_DEFAULTS :SLAVE_DEFAULTS
key master_key_download_url :master_key_download_url
key url_ready_file :url-ready-file
key expose_csr_organization :organization
key expose_csr_organizational_unit :organizational-unit
key global_ipv6 slap-configuration:ipv6-random
key empty_template software-release-path:template-empty
key template_expose_csr_nginx_conf software-release-path:template-expose-csr-nginx-conf
key software_type :software_type
key http3_enable :http3-enable
key frontend_lazy_graceful_reload frontend-haproxy-lazy-graceful:output
key monitor_base_url monitor-instance-parameter:monitor-base-url
key node_id frontend-node-id:value
key version_hash version-hash:value
key software_release_url version-hash:software-release-url
key node_information frontend-node-information:value
# BBB: SlapOS Master non-zero knowledge BEGIN
key apache_certificate certificate-chain:output
# BBB: SlapOS Master non-zero knowledge END
key custom_ssl_directory frontend-directory:custom-ssl-directory
## frontend haproxy
key template_frontend_haproxy_configuration software-release-path:template-frontend-haproxy-configuration
key template_frontend_haproxy_crt_list software-release-path:template-frontend-haproxy-crt-list
## backend haproxy
key template_backend_haproxy_configuration software-release-path:template-backend-haproxy-configuration
key SLAVE_DEFAULTS :SLAVE_DEFAULTS {#- Those defaults are needed as the profile handles slave preparation #}
## Configuration passed by section
section dynamic_profile_configuration dynamic-custom-personal-profile-slave-list-config
section frontend_directory frontend-directory
section configuration configuration
section FRONTEND_USER_DEFAULTS FRONTEND_USER_DEFAULTS
section FRONTEND_GLOBAL_DEFAULTS FRONTEND_GLOBAL_DEFAULTS
section frontend_haproxy_configuration frontend-haproxy-configuration
section backend_haproxy_configuration backend-haproxy-configuration
section instance_parameter_dict instance-parameter-section
......
......@@ -13,8 +13,8 @@
{%- set slave_log_dict = {} %}
{%- set slave_instance_information_list = [] %}
{%- set slave_instance_list = configuration['extra_slave_instance_list'] %}
{%- if master_key_download_url %}
{%- do kedifa_updater_mapping.append((master_key_download_url, frontend_haproxy_configuration['master-certificate'], apache_certificate)) %}
{%- if dynamic_profile_configuration['master-key-download-url'] %}
{%- do kedifa_updater_mapping.append((dynamic_profile_configuration['master-key-download-url'], frontend_haproxy_configuration['master-certificate'], apache_certificate)) %}
{%- else %}
{%- do kedifa_updater_mapping.append(('notreadyyet', frontend_haproxy_configuration['master-certificate'], apache_certificate)) %}
{%- endif %}
......@@ -666,7 +666,7 @@ init =
[key-download-url-ready]
recipe = slapos.recipe.build
output = {{ url_ready_file }}
master-key-download-url = {{ master_key_download_url }}
master-key-download-url = {{ dynamic_profile_configuration['master-key-download-url'] }}
slave-kedifa-information = {{ dumps(slave_kedifa_information) }}
init =
not_ready_count = 0
......
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