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

caddy-frontend: Improve naming of parameters

That's true, that those are templates, but the important information which
shall be in the name of the parameter is its purpose - a profile.
parent c57de240
...@@ -14,29 +14,29 @@ ...@@ -14,29 +14,29 @@
# not need these here). # not need these here).
[template] [template]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = 5870881f37b6aa0f112d68f24472c64d md5sum = 9540d96bf8fe36091b44b9d6a515b45d
[template-common] [profile-common]
filename = instance-common.cfg.in filename = instance-common.cfg.in
md5sum = 5784bea3bd608913769ff9a8afcccb68 md5sum = 5784bea3bd608913769ff9a8afcccb68
[template-caddy-frontend] [profile-caddy-frontend]
filename = instance-apache-frontend.cfg.in filename = instance-apache-frontend.cfg.in
md5sum = 02aac183352a6fd6ddd336d2e3757405 md5sum = ce1051040869f3040015e76c9a0085db
[template-caddy-replicate] [profile-caddy-replicate]
filename = instance-apache-replicate.cfg.in filename = instance-apache-replicate.cfg.in
md5sum = 54c0648c8593699dae0c565bc7dd8629 md5sum = edda797f5bbc4533927bc4e9c9e21333
[template-slave-list] [profile-slave-list]
_update_hash_filename_ = templates/apache-custom-slave-list.cfg.in _update_hash_filename_ = templates/apache-custom-slave-list.cfg.in
md5sum = 2690fb2b5b6cefb7de53f35c214bdd52 md5sum = 30d87315036c7e538c81139cb7cc4620
[template-replicate-publish-slave-information] [profile-replicate-publish-slave-information]
_update_hash_filename_ = templates/replicate-publish-slave-information.cfg.in _update_hash_filename_ = templates/replicate-publish-slave-information.cfg.in
md5sum = 7e3ee70c447f8203273d78f66ab519c3 md5sum = de268251dafa5ad83ebf5b20636365d9
[template-caddy-frontend-configuration] [profile-caddy-frontend-configuration]
_update_hash_filename_ = templates/Caddyfile.in _update_hash_filename_ = templates/Caddyfile.in
md5sum = 2503056e35463e045db3329bb8b6fae8 md5sum = 2503056e35463e045db3329bb8b6fae8
...@@ -112,9 +112,9 @@ md5sum = 8e1c6c06c09beb921965b3ce98c67c9e ...@@ -112,9 +112,9 @@ md5sum = 8e1c6c06c09beb921965b3ce98c67c9e
filename = caddyprofiledummy.py filename = caddyprofiledummy.py
md5sum = 38792c2dceae38ab411592ec36fff6a8 md5sum = 38792c2dceae38ab411592ec36fff6a8
[template-kedifa] [profile-kedifa]
filename = instance-kedifa.cfg.in filename = instance-kedifa.cfg.in
md5sum = d76fe7bf062410eda7049446ed06a736 md5sum = 6aeb6a157605b20a8a81cf7b1590ff7c
[template-backend-haproxy-rsyslogd-conf] [template-backend-haproxy-rsyslogd-conf]
_update_hash_filename_ = templates/backend-haproxy-rsyslogd.conf.in _update_hash_filename_ = templates/backend-haproxy-rsyslogd.conf.in
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
{%- set TRUE_VALUES = ['y', 'yes', '1', 'true'] -%} {%- set TRUE_VALUES = ['y', 'yes', '1', 'true'] -%}
[buildout] [buildout]
extends = extends =
{{ parameter_dict['common_profile'] }} {{ parameter_dict['profile_common'] }}
{{ parameter_dict['monitor_template'] }} {{ parameter_dict['profile_monitor'] }}
{{ parameter_dict['logrotate_base_instance'] }} {{ parameter_dict['profile_logrotate_base'] }}
parts = parts =
directory directory
...@@ -98,8 +98,8 @@ slave-introspection-var = ${:var}/slave-introspection ...@@ -98,8 +98,8 @@ slave-introspection-var = ${:var}/slave-introspection
[switch-caddy-softwaretype] [switch-caddy-softwaretype]
recipe = slapos.cookbook:softwaretype recipe = slapos.cookbook:softwaretype
single-default = ${dynamic-custom-personal-template-slave-list:rendered} single-default = ${dynamic-custom-personal-profile-slave-list:rendered}
single-custom-personal = ${dynamic-custom-personal-template-slave-list:rendered} single-custom-personal = ${dynamic-custom-personal-profile-slave-list:rendered}
[frontend-configuration] [frontend-configuration]
template-log-access = {{ parameter_dict['template_log_access'] }} template-log-access = {{ parameter_dict['template_log_access'] }}
...@@ -168,9 +168,9 @@ slapparameter_dict = {{ dumps(instance_parameter['configuration']) }} ...@@ -168,9 +168,9 @@ slapparameter_dict = {{ dumps(instance_parameter['configuration']) }}
slap_software_type = {{ dumps(instance_parameter['slap-software-type']) }} slap_software_type = {{ dumps(instance_parameter['slap-software-type']) }}
context = context =
import json_module json import json_module json
raw common_profile {{ parameter_dict['common_profile'] }} raw profile_common {{ parameter_dict['profile_common'] }}
raw logrotate_base_instance {{ parameter_dict['logrotate_base_instance'] }} raw profile_logrotate_base {{ parameter_dict['profile_logrotate_base'] }}
raw monitor_template {{ parameter_dict['monitor_template'] }} raw profile_monitor {{ parameter_dict['profile_monitor'] }}
key slap_software_type :slap_software_type key slap_software_type :slap_software_type
key slapparameter_dict :slapparameter_dict key slapparameter_dict :slapparameter_dict
section directory directory section directory directory
...@@ -277,10 +277,10 @@ stop-on-error = True ...@@ -277,10 +277,10 @@ stop-on-error = True
template_csr='${backend-client-login-csr:template-csr}' template_csr='${backend-client-login-csr:template-csr}'
)}} )}}
[dynamic-custom-personal-template-slave-list] [dynamic-custom-personal-profile-slave-list]
< = jinja2-template-base < = jinja2-template-base
depends = ${caddyprofiledeps:recipe} depends = ${caddyprofiledeps:recipe}
template = {{ parameter_dict['template_slave_list'] }} template = {{ parameter_dict['profile_slave_list'] }}
filename = custom-personal-instance-slave-list.cfg filename = custom-personal-instance-slave-list.cfg
slave_instance_list = {{ dumps(instance_parameter['slave-instance-list']) }} slave_instance_list = {{ dumps(instance_parameter['slave-instance-list']) }}
extra_slave_instance_list = {{ dumps(instance_parameter.get('configuration.extra_slave_instance_list')) }} extra_slave_instance_list = {{ dumps(instance_parameter.get('configuration.extra_slave_instance_list')) }}
......
...@@ -20,7 +20,7 @@ rendered = ${buildout:directory}/${:filename} ...@@ -20,7 +20,7 @@ rendered = ${buildout:directory}/${:filename}
extra-context = extra-context =
context = context =
import json_module json import json_module json
raw common_profile {{ common_profile }} raw profile_common {{ profile_common }}
${:extra-context} ${:extra-context}
{% set popen = functools_module.partial(subprocess_module.Popen, stdout=subprocess_module.PIPE, stderr=subprocess_module.STDOUT, stdin=subprocess_module.PIPE) %} {% set popen = functools_module.partial(subprocess_module.Popen, stdout=subprocess_module.PIPE, stderr=subprocess_module.STDOUT, stdin=subprocess_module.PIPE) %}
...@@ -773,8 +773,8 @@ hash-existing-files = ${buildout:directory}/software_release/buildout.cfg ...@@ -773,8 +773,8 @@ hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
[buildout] [buildout]
extends = extends =
{{ common_profile }} {{ profile_common }}
{{ template_monitor }} {{ profile_monitor2 }}
parts = parts =
monitor-base monitor-base
publish-slave-information publish-slave-information
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
# KeDiFa instance profile # KeDiFa instance profile
[buildout] [buildout]
extends = extends =
{{ parameter_dict['common_profile'] }} {{ parameter_dict['profile_common'] }}
{{ parameter_dict['monitor_template'] }} {{ parameter_dict['profile_monitor'] }}
{{ parameter_dict['logrotate_base_instance'] }} {{ parameter_dict['profile_logrotate_base'] }}
parts = parts =
monitor-base monitor-base
...@@ -195,7 +195,7 @@ slapparameter_dict = {{ dumps(instance_parameter['configuration']) }} ...@@ -195,7 +195,7 @@ slapparameter_dict = {{ dumps(instance_parameter['configuration']) }}
slap_software_type = {{ dumps(instance_parameter['slap-software-type']) }} slap_software_type = {{ dumps(instance_parameter['slap-software-type']) }}
context = context =
import json_module json import json_module json
raw common_profile {{ parameter_dict['common_profile'] }} raw profile_common {{ parameter_dict['profile_common'] }}
key slap_software_type :slap_software_type key slap_software_type :slap_software_type
key slapparameter_dict :slapparameter_dict key slapparameter_dict :slapparameter_dict
section directory directory section directory directory
......
[buildout] [buildout]
extends = {{ template_frontend_parameter_dict['common_profile'] }} extends = {{ template_frontend_parameter_dict['profile_common'] }}
parts = parts =
dynamic-template-caddy-replicate
switch-softwaretype switch-softwaretype
[caddyprofiledeps] [caddyprofiledeps]
...@@ -22,22 +21,22 @@ context = ...@@ -22,22 +21,22 @@ context =
[switch-softwaretype] [switch-softwaretype]
recipe = slapos.cookbook:softwaretype recipe = slapos.cookbook:softwaretype
default = ${dynamic-template-caddy-replicate:rendered} default = ${dynamic-profile-caddy-replicate:rendered}
RootSoftwareInstance = ${dynamic-template-caddy-replicate:rendered} RootSoftwareInstance = ${dynamic-profile-caddy-replicate:rendered}
custom-personal = ${dynamic-template-caddy-replicate:rendered} custom-personal = ${dynamic-profile-caddy-replicate:rendered}
single-default = ${dynamic-template-caddy-frontend:rendered} single-default = ${dynamic-profile-caddy-frontend:rendered}
single-custom-personal = ${dynamic-template-caddy-frontend:rendered} single-custom-personal = ${dynamic-profile-caddy-frontend:rendered}
replicate = ${dynamic-template-caddy-replicate:rendered} replicate = ${dynamic-profile-caddy-replicate:rendered}
kedifa = ${dynamic-template-kedifa:rendered} kedifa = ${dynamic-profile-kedifa:rendered}
[dynamic-parameter-section] [dynamic-parameter-section]
{% for key,value in template_frontend_parameter_dict.iteritems() %} {% for key,value in template_frontend_parameter_dict.iteritems() %}
{{ key }} = {{ dumps(value) }} {{ key }} = {{ dumps(value) }}
{% endfor -%} {% endfor -%}
[dynamic-template-caddy-frontend] [dynamic-profile-caddy-frontend]
< = jinja2-template-base < = jinja2-template-base
template = {{ template_frontend_parameter_dict['template_caddy_frontend'] }} template = {{ template_frontend_parameter_dict['profile_caddy_frontend'] }}
filename = instance-caddy-frontend.cfg filename = instance-caddy-frontend.cfg
extensions = jinja2.ext.do extensions = jinja2.ext.do
extra-context = extra-context =
...@@ -48,10 +47,10 @@ caucase-jinja2-library = {{ template_frontend_parameter_dict['caucase_jinja2_lib ...@@ -48,10 +47,10 @@ caucase-jinja2-library = {{ template_frontend_parameter_dict['caucase_jinja2_lib
import-list = import-list =
file caucase :caucase-jinja2-library file caucase :caucase-jinja2-library
[dynamic-template-caddy-replicate] [dynamic-profile-caddy-replicate]
< = jinja2-template-base < = jinja2-template-base
depends = ${caddyprofiledeps:recipe} depends = ${caddyprofiledeps:recipe}
template = {{ template_frontend_parameter_dict['template_caddy_replicate'] }} template = {{ template_frontend_parameter_dict['profile_caddy_replicate'] }}
filename = instance-caddy-replicate.cfg filename = instance-caddy-replicate.cfg
extensions = jinja2.ext.do extensions = jinja2.ext.do
extra-context = extra-context =
...@@ -60,19 +59,19 @@ extra-context = ...@@ -60,19 +59,19 @@ extra-context =
import validators validators import validators validators
key cluster_identification instance-parameter:root-instance-title key cluster_identification instance-parameter:root-instance-title
raw caddy_backend_url_validator {{ template_frontend_parameter_dict['caddy_backend_url_validator'] }} raw caddy_backend_url_validator {{ template_frontend_parameter_dict['caddy_backend_url_validator'] }}
raw template_publish_slave_information {{ template_frontend_parameter_dict['template_replicate_publish_slave_information'] }} raw template_publish_slave_information {{ template_frontend_parameter_dict['profile_replicate_publish_slave_information'] }}
# Must match the key id in [switch-softwaretype] which uses this section. # Must match the key id in [switch-softwaretype] which uses this section.
raw software_type RootSoftwareInstance-default-custom-personal-replicate raw software_type RootSoftwareInstance-default-custom-personal-replicate
raw template_monitor {{ template_frontend_parameter_dict['template_monitor2'] }} raw profile_monitor2 {{ template_frontend_parameter_dict['profile_monitor2'] }}
raw common_profile {{ template_frontend_parameter_dict['common_profile'] }} raw profile_common {{ template_frontend_parameter_dict['profile_common'] }}
section parameter_dict dynamic-parameter-section section parameter_dict dynamic-parameter-section
caucase-jinja2-library = {{ template_frontend_parameter_dict['caucase_jinja2_library'] }} caucase-jinja2-library = {{ template_frontend_parameter_dict['caucase_jinja2_library'] }}
import-list = import-list =
file caucase :caucase-jinja2-library file caucase :caucase-jinja2-library
[dynamic-template-kedifa] [dynamic-profile-kedifa]
< = jinja2-template-base < = jinja2-template-base
template = {{ template_frontend_parameter_dict['template_kedifa'] }} template = {{ template_frontend_parameter_dict['profile_kedifa'] }}
filename = instance-kedifa.cfg filename = instance-kedifa.cfg
extensions = jinja2.ext.do extensions = jinja2.ext.do
extra-context = extra-context =
......
...@@ -73,7 +73,7 @@ eggs = ...@@ -73,7 +73,7 @@ eggs =
websockify websockify
collective.recipe.shelloutput collective.recipe.shelloutput
[template-common] [profile-common]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance-common.cfg.in template = ${:_profile_base_location_}/instance-common.cfg.in
rendered = ${buildout:directory}/instance-common.cfg rendered = ${buildout:directory}/instance-common.cfg
...@@ -87,26 +87,26 @@ context = ...@@ -87,26 +87,26 @@ context =
caucase_jinja2_library = ${caucase-jinja2-library:target} caucase_jinja2_library = ${caucase-jinja2-library:target}
# profiles # profiles
common_profile = ${template-common:rendered} profile_caddy_frontend = ${profile-caddy-frontend:target}
template_caddy_frontend = ${template-caddy-frontend:target} profile_caddy_replicate = ${profile-caddy-replicate:target}
template_caddy_replicate = ${template-caddy-replicate:target} profile_common = ${profile-common:rendered}
template_replicate_publish_slave_information = ${template-replicate-publish-slave-information:target} profile_kedifa = ${profile-kedifa:target}
template_slave_list = ${template-slave-list:target} profile_logrotate_base = ${template-logrotate-base:rendered}
template_kedifa = ${template-kedifa:target} profile_monitor = ${monitor-template:output}
profile_monitor2 = ${monitor2-template:rendered}
profile_replicate_publish_slave_information = ${profile-replicate-publish-slave-information:target}
profile_slave_list = ${profile-slave-list:target}
# templates # templates
logrotate_base_instance = ${template-logrotate-base:rendered}
monitor_template = ${monitor-template:output}
template_backend_haproxy_configuration = ${template-backend-haproxy-configuration:target} template_backend_haproxy_configuration = ${template-backend-haproxy-configuration:target}
template_backend_haproxy_rsyslogd_conf = ${template-backend-haproxy-rsyslogd-conf:target} template_backend_haproxy_rsyslogd_conf = ${template-backend-haproxy-rsyslogd-conf:target}
template_caddy_frontend_configuration = ${template-caddy-frontend-configuration:target} template_caddy_frontend_configuration = ${profile-caddy-frontend-configuration:target}
template_caddy_lazy_script_call = ${template-caddy-lazy-script-call:target} template_caddy_lazy_script_call = ${template-caddy-lazy-script-call:target}
template_configuration_state_script = ${template-configuration-state-script:target} template_configuration_state_script = ${template-configuration-state-script:target}
template_default_slave_virtualhost = ${template-default-slave-virtualhost:target} template_default_slave_virtualhost = ${template-default-slave-virtualhost:target}
template_empty = ${template-empty:target} template_empty = ${template-empty:target}
template_graceful_script = ${template-graceful-script:target} template_graceful_script = ${template-graceful-script:target}
template_log_access = ${template-log-access:target} template_log_access = ${template-log-access:target}
template_monitor2 = ${monitor2-template:rendered}
template_not_found_html = ${template-not-found-html:target} template_not_found_html = ${template-not-found-html:target}
template_rotate_script = ${template-rotate-script:target} template_rotate_script = ${template-rotate-script:target}
template_slave_introspection_httpd_nginx = ${template-slave-introspection-httpd-nginx:target} template_slave_introspection_httpd_nginx = ${template-slave-introspection-httpd-nginx:target}
...@@ -150,7 +150,7 @@ mode = 0644 ...@@ -150,7 +150,7 @@ mode = 0644
context = context =
section template_frontend_parameter_dict template-frontend-parameter-section section template_frontend_parameter_dict template-frontend-parameter-section
[template-caddy-frontend] [profile-caddy-frontend]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-apache-frontend.cfg.in url = ${:_profile_base_location_}/instance-apache-frontend.cfg.in
mode = 0644 mode = 0644
...@@ -161,12 +161,12 @@ url = ${:_profile_base_location_}/${:filename} ...@@ -161,12 +161,12 @@ url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/caddy-backend-url-validator output = ${buildout:directory}/caddy-backend-url-validator
mode = 0750 mode = 0750
[template-caddy-replicate] [profile-caddy-replicate]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-apache-replicate.cfg.in url = ${:_profile_base_location_}/instance-apache-replicate.cfg.in
mode = 0644 mode = 0644
[template-kedifa] [profile-kedifa]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-kedifa.cfg.in url = ${:_profile_base_location_}/instance-kedifa.cfg.in
mode = 0644 mode = 0644
...@@ -176,13 +176,13 @@ recipe = slapos.recipe.build:download ...@@ -176,13 +176,13 @@ recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:_update_hash_filename_} url = ${:_profile_base_location_}/${:_update_hash_filename_}
mode = 640 mode = 640
[template-slave-list] [profile-slave-list]
<=download-template <=download-template
[template-replicate-publish-slave-information] [profile-replicate-publish-slave-information]
<=download-template <=download-template
[template-caddy-frontend-configuration] [profile-caddy-frontend-configuration]
<=download-template <=download-template
[template-not-found-html] [template-not-found-html]
......
...@@ -30,7 +30,7 @@ recipe = slapos.recipe.template:jinja2 ...@@ -30,7 +30,7 @@ recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do extensions = jinja2.ext.do
extra-context = extra-context =
context = context =
raw common_profile {{ common_profile }} raw profile_common {{ profile_common }}
${:extra-context} ${:extra-context}
# empty sections if no slaves are available # empty sections if no slaves are available
...@@ -479,9 +479,9 @@ command = ...@@ -479,9 +479,9 @@ command =
[buildout] [buildout]
extends = extends =
{{ common_profile }} {{ profile_common }}
{{ logrotate_base_instance }} {{ profile_logrotate_base }}
{{ monitor_template }} {{ profile_monitor }}
parts += parts +=
kedifa-updater kedifa-updater
......
...@@ -75,7 +75,7 @@ log-access-url = {{ dumps(json_module.dumps(log_access_url, sort_keys=True)) }} ...@@ -75,7 +75,7 @@ log-access-url = {{ dumps(json_module.dumps(log_access_url, sort_keys=True)) }}
{% endfor %} {% endfor %}
[buildout] [buildout]
extends = {{ common_profile }} extends = {{ profile_common }}
parts = parts =
{% for part in part_list %} {% for part in part_list %}
{{ ' %s' % part }} {{ ' %s' % part }}
......
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