Commit 4e3ad90e authored by Rafael Monnerat's avatar Rafael Monnerat

apache-frontent: remove section from the loop.

parent 802493b3
...@@ -66,13 +66,13 @@ mode = 0644 ...@@ -66,13 +66,13 @@ mode = 0644
[template-slave-list] [template-slave-list]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/templates/apache-custom-slave-list.cfg.in url = ${:_profile_base_location_}/templates/apache-custom-slave-list.cfg.in
md5sum = 8fd6f0277883d893e01e71238091e81e md5sum = a79c5d53baa335b89deeb8ce0b88b645
mode = 640 mode = 640
[template-slave-configuration] [template-slave-configuration]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/templates/custom-virtualhost.conf.in url = ${:_profile_base_location_}/templates/custom-virtualhost.conf.in
md5sum = a7ad2e83b7f919fc45a7ef1e64344dcb md5sum = d103143e5d50682bd5ad43117d82e2fa
mode = 640 mode = 640
[template-replicate-publish-slave-information] [template-replicate-publish-slave-information]
......
...@@ -177,15 +177,14 @@ key-content = {{ dumps(slave_instance.get('ssl_key')) }} ...@@ -177,15 +177,14 @@ key-content = {{ dumps(slave_instance.get('ssl_key')) }}
cert-content = {{ dumps(slave_instance.get('ssl_crt')) }} cert-content = {{ dumps(slave_instance.get('ssl_crt')) }}
{% endif -%} {% endif -%}
{# Set apache configuration value for slave #} {# ########################################## #}
{# Set Slave Configuration #}
[{{ slave_configuration_section_name }}] [{{ slave_configuration_section_name }}]
{% set apache_custom_http = ((slave_instance.pop('apache_custom_http', '')) % slave_parameter_dict) -%} {% set apache_custom_http = ((slave_instance.pop('apache_custom_http', '')) % slave_parameter_dict) -%}
{% set apache_custom_https = ((slave_instance.pop('apache_custom_https', '')) % slave_parameter_dict) -%} {% set apache_custom_https = ((slave_instance.pop('apache_custom_https', '')) % slave_parameter_dict) -%}
apache_custom_http = {{ dumps(apache_custom_http) }} apache_custom_http = {{ dumps(apache_custom_http) }}
apache_custom_https = {{ dumps(apache_custom_https) }} apache_custom_https = {{ dumps(apache_custom_https) }}
{# ############################ #}
{# #### Set Slave Configuration #}
[{{ slave_section_title }}] [{{ slave_section_title }}]
< = jinja2-template-base < = jinja2-template-base
{% if slave_instance.has_key('apache_custom_http') %} {% if slave_instance.has_key('apache_custom_http') %}
...@@ -199,8 +198,6 @@ extensions = jinja2.ext.do ...@@ -199,8 +198,6 @@ extensions = jinja2.ext.do
extra-context = extra-context =
raw https_port {{ https_port }} raw https_port {{ https_port }}
raw http_port {{ http_port }} raw http_port {{ http_port }}
key apache_custom_https {{ 'slave-instance-%s-configuration:apache_custom_https' % slave_reference }}
key apache_custom_http {{ 'slave-instance-%s-configuration:apache_custom_http' % slave_reference }}
section slave_parameter {{ slave_configuration_section_name }} section slave_parameter {{ slave_configuration_section_name }}
{{ '\n' }} {{ '\n' }}
...@@ -210,6 +207,21 @@ extra-context = ...@@ -210,6 +207,21 @@ extra-context =
{% endfor %} {% endfor %}
############################ ############################
#### Publish Slave Information
{% if not extra_slave_instance_list -%}
{% set publish_section_title = 'publish-%s-connection-information' % slave_instance.get('slave_reference') -%}
{% do part_list.append(publish_section_title) -%}
[{{ publish_section_title }}]
recipe = slapos.cookbook:publish
{% for key, value in slave_publish_dict.iteritems() %}
{{ key }} = {{ value }}
{% endfor %}
{% else -%}
{% do slave_instance_information_list.append(slave_publish_dict) -%}
{% endif -%}
{% endfor -%}
###############################################
### Prepare virtualhost for slaves using cache ### Prepare virtualhost for slaves using cache
{% for slave_reference, slave_configuration_section_name in cached_server_dict.iteritems() %} {% for slave_reference, slave_configuration_section_name in cached_server_dict.iteritems() %}
...@@ -228,24 +240,6 @@ extra-context = ...@@ -228,24 +240,6 @@ extra-context =
{{ '\n' }} {{ '\n' }}
{% endfor %} {% endfor %}
############################
#### Publish Slave Information
# Publish slave information
{% if not extra_slave_instance_list -%}
{% set publish_section_title = 'publish-%s-connection-information' % slave_instance.get('slave_reference') -%}
{% do part_list.append(publish_section_title) -%}
[{{ publish_section_title }}]
recipe = slapos.cookbook:publish
{% for key, value in slave_publish_dict.iteritems() %}
{{ key }} = {{ value }}
{% endfor %}
{% else -%}
{% do slave_instance_information_list.append(slave_publish_dict) -%}
{% endif -%}
{% endfor -%}
[slave-log-directories] [slave-log-directories]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
{% for key, value in slave_log_dict.iteritems() -%} {% for key, value in slave_log_dict.iteritems() -%}
......
<VirtualHost *:{{ https_port }}> <VirtualHost *:{{ https_port }}>
{{ apache_custom_https }} {{ slave_parameter.get('apache_custom_https', '') }}
</VirtualHost> </VirtualHost>
<VirtualHost *:{{ http_port }}> <VirtualHost *:{{ http_port }}>
{{ apache_custom_http }} {{ slave_parameter.get('apache_custom_https', '') }}
  • @romain @rafael This change has a side effect to use apache_custom_https instead of apache_custom_http. It must be the cause for #20170414-1800C9F.

Please register or sign in to reply
</VirtualHost> </VirtualHost>
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