Commit 4b107259 authored by Łukasz Nowak's avatar Łukasz Nowak

caddy-frontend: Fix frontend information per slave

Publish only for active slaves.
parent 96744bb4
...@@ -34,7 +34,7 @@ md5sum = aba91817a1b58377597500f676603d23 ...@@ -34,7 +34,7 @@ md5sum = aba91817a1b58377597500f676603d23
[profile-master-publish-slave-information] [profile-master-publish-slave-information]
filename = instance-master-publish-slave-information.cfg.in filename = instance-master-publish-slave-information.cfg.in
md5sum = b3422f3624054f57b78d0e50a0de399a md5sum = e03eef8feee481256928a0e9249642c5
[template-caddy-frontend-configuration] [template-caddy-frontend-configuration]
_update_hash_filename_ = templates/Caddyfile.in _update_hash_filename_ = templates/Caddyfile.in
......
...@@ -52,6 +52,11 @@ ...@@ -52,6 +52,11 @@
{% endif %} {% endif %}
{% endfor %} {% endfor %}
[common-frontend-information]
{% for frontend_key, frontend_value in frontend_information.items() %}
{{ frontend_key }} = {{ frontend_value }}
{% endfor %}
# Publish information for each slave # Publish information for each slave
{% set active_slave_instance_list = json_module.loads(active_slave_instance_dict['active-slave-instance-list']) %} {% set active_slave_instance_list = json_module.loads(active_slave_instance_dict['active-slave-instance-list']) %}
{% for slave_reference, slave_information in slave_information_dict.items() %} {% for slave_reference, slave_information in slave_information_dict.items() %}
...@@ -61,6 +66,7 @@ ...@@ -61,6 +66,7 @@
{% set publish_section_title = 'publish-%s' % slave_reference %} {% set publish_section_title = 'publish-%s' % slave_reference %}
{% do part_list.append(publish_section_title) %} {% do part_list.append(publish_section_title) %}
[{{ publish_section_title }}] [{{ publish_section_title }}]
<= common-frontend-information
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
-slave-reference = {{ slave_reference }} -slave-reference = {{ slave_reference }}
{% set log_access_url = slave_information.pop('log-access-urls', None) %} {% set log_access_url = slave_information.pop('log-access-urls', None) %}
...@@ -72,9 +78,6 @@ log-access-url = {{ dumps(json_module.dumps(log_access_url, sort_keys=True)) }} ...@@ -72,9 +78,6 @@ log-access-url = {{ dumps(json_module.dumps(log_access_url, sort_keys=True)) }}
{{ key }} = {{ dumps(value) }} {{ key }} = {{ dumps(value) }}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% for frontend_key, frontend_value in frontend_information.items() %}
{{ frontend_key }} = {{ frontend_value }}
{% endfor %}
{% endfor %} {% endfor %}
[buildout] [buildout]
......
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