Commit 6f6aca4d authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

apache-frontend: Small improvments on profile and templates for apache frontend

parent 469f67a8
...@@ -20,8 +20,7 @@ context = ...@@ -20,8 +20,7 @@ context =
template = {{ template_slave_configuration }} template = {{ template_slave_configuration }}
filename = {{ '%s.conf' % slave_reference }} filename = {{ '%s.conf' % slave_reference }}
extra-context = extra-context =
key apache_custom_https {{ 'slave-instance-%s-configuration:custom-https' % slave_reference }} section slave_parameter {{ 'slave-instance-%s-configuration' % slave_reference }}
key apache_custom_http {{ 'slave-instance-%s-configuration:custom-http' % slave_reference }}
raw https_port {{ https_port }} raw https_port {{ https_port }}
raw http_port {{ http_port }} raw http_port {{ http_port }}
{{ '\n' }} {{ '\n' }}
...@@ -32,7 +31,7 @@ extra-context = ...@@ -32,7 +31,7 @@ extra-context =
{% set cert_title = '%s-%s' % (slave_reference, cert_name.replace('ssl_', '')) -%} {% set cert_title = '%s-%s' % (slave_reference, cert_name.replace('ssl_', '')) -%}
{% set cert_file = '/'.join([custom_ssl_directory, cert_title.replace('-','.')]) -%} {% set cert_file = '/'.join([custom_ssl_directory, cert_title.replace('-','.')]) -%}
{% do part_list.append(cert_title) -%} {% do part_list.append(cert_title) -%}
{% do slave_parameter_dict.update([(cert_name, cert_file)]) -%} {% do slave_parameter_dict.__setitem__(cert_name, cert_file) -%}
[{{ cert_title }}] [{{ cert_title }}]
< = jinja2-template-base < = jinja2-template-base
template = {{ empty_template }} template = {{ empty_template }}
...@@ -49,13 +48,13 @@ value = {{ dumps(slave_instance.get(cert_name)) }} ...@@ -49,13 +48,13 @@ value = {{ dumps(slave_instance.get(cert_name)) }}
[{{ ('slave-instance-%s-configuration' % slave_reference) }}] [{{ ('slave-instance-%s-configuration' % slave_reference) }}]
{% set apache_custom_http = ((slave_instance.get('apache_custom_http', '')) % slave_parameter_dict) -%} {% set apache_custom_http = ((slave_instance.get('apache_custom_http', '')) % slave_parameter_dict) -%}
{% set apache_custom_https = ((slave_instance.get('apache_custom_https', '')) % slave_parameter_dict) -%} {% set apache_custom_https = ((slave_instance.get('apache_custom_https', '')) % slave_parameter_dict) -%}
custom-http = {{ dumps(apache_custom_http) }} apache_custom_http = {{ dumps(apache_custom_http) }}
custom-https = {{ dumps(apache_custom_https) }} apache_custom_https = {{ dumps(apache_custom_https) }}
{{ '\n' }} {{ '\n' }}
# The slave use cache # The slave use cache
{% if 'enable_cache' in slave_instance and 'url' in slave_instance and 'server_name' in slave_instance -%} {% if 'enable_cache' in slave_instance and 'url' in slave_instance and 'server_name' in slave_instance -%}
{% do cached_server_dict.update([(slave_instance.get('server_name'), slave_instance.get('url'))]) -%} {% do cached_server_dict.__setitem__(slave_instance.get('server_name'), slave_instance.get('url')) -%}
{% endif -%} {% endif -%}
{% endfor -%} {% endfor -%}
...@@ -82,4 +81,4 @@ parts += ...@@ -82,4 +81,4 @@ parts +=
eggs-directory = {{ eggs_directory }} eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }} develop-eggs-directory = {{ develop_eggs_directory }}
offline = true offline = true
cache-access = {{ cache_access }} cache-access = {{ cache_access }}
\ No newline at end of file
...@@ -102,4 +102,4 @@ mode = 640 ...@@ -102,4 +102,4 @@ mode = 640
[template-empty] [template-empty]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/empty.in url = ${:_profile_base_location_}/empty.in
mode = 640 mode = 640
\ No newline at end of file
...@@ -302,12 +302,12 @@ wrapper-path = $${directory:service}/squid-reload ...@@ -302,12 +302,12 @@ wrapper-path = $${directory:service}/squid-reload
[frontend-apache-graceful] [frontend-apache-graceful]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
command-line = ${buildout:bin-directory}/killpidfromfile $${apache-configuration:pid-file} SIGUSR1 command-line = ${buildout:bin-directory}/killpidfromfile $${apache-configuration:pid-file} SIGUSR1
wrapper-path = $${directory:service}/frontend-apache-graceful wrapper-path = $${directory:run}/frontend-apache-graceful
[cached-apache-graceful] [cached-apache-graceful]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
command-line = ${buildout:bin-directory}/killpidfromfile $${apache-configuration:cache-pid-file} SIGUSR1 command-line = ${buildout:bin-directory}/killpidfromfile $${apache-configuration:cache-pid-file} SIGUSR1
wrapper-path = $${directory:service}/cached-apache-graceful wrapper-path = $${directory:run}/cached-apache-graceful
[promise-apache-frontend-v4-https] [promise-apache-frontend-v4-https]
recipe = slapos.cookbook:check_port_listening recipe = slapos.cookbook:check_port_listening
......
<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_http','') }}
</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