Commit fc2feb1a authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

software.apache-frontend: Use dedicated jinja section for trafficserver

If not so, trafficserver configuration is removed and then replaced on
every slapos node instance call making traffic server unstable
parent fe67e4b5
......@@ -56,7 +56,7 @@ mode = 0644
[template-apache-frontend]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-apache-frontend.cfg
md5sum = 0ca52aa73c2547499b2f62fc72288f45
md5sum = f093d1f85449c9a8d48ccd5a32980c1d
output = ${buildout:directory}/template-apache-frontend.cfg
mode = 0644
......@@ -144,7 +144,7 @@ md5sum = 8cde04bfd0c0e9bd56744b988275cfd8
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/templates/trafficserver/${:filename}
md5sum = 59287d2de3d948b135619edd211a5e84
md5sum = 7578b780c6bffdbadb130b796c874d29
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = records.config.jinja2
download-only = true
......@@ -154,7 +154,7 @@ mode = 0644
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/templates/trafficserver/${:filename}
md5sum = 23c83efaf2fb0f9f0b3096bbfdda05c1
md5sum = 117238225b3fc3c5b5be381815f44c67
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = storage.config.jinja2
download-only = true
......
......@@ -115,6 +115,7 @@ configuration.apache-ca-certificate =
configuration.open-port = 80 443
configuration.extra_slave_instance_list =
configuration.disk-cache-size = 8G
configuration.ram-cache-size = 1G
configuration.trafficserver-autoconf-port = 8083
configuration.trafficserver-mgmt-port = 8084
configuration.re6st-verification-url = http://[2001:67c:1254:4::1]/index.html
......@@ -406,6 +407,7 @@ cache-path = $${trafficserver-directory:cache-path}
disk-cache-size = $${instance-parameter:configuration.disk-cache-size}
autoconf-port = $${instance-parameter:configuration.trafficserver-autoconf-port}
mgmt-port = $${instance-parameter:configuration.trafficserver-mgmt-port}
ram-cache-size = $${instance-parameter:configuration.ram-cache-size}
[trafficserver-configuration-directory]
recipe = plone.recipe.command
......@@ -424,37 +426,40 @@ command-line = ${trafficserver:location}/bin/traffic_line -x
wrapper-path = $${trafficserver-variable:reload-path}
environment = TS_ROOT=$${buildout:directory}
# XXX Dedicated Jinja Section without slapparameter
[trafficserver-jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = $${trafficserver-directory:configuration}/$${:filename}
extra-context =
mode = 600
context =
section ats_directory trafficserver-directory
section ats_configuration trafficserver-variable
$${:extra-context}
[trafficserver-records-config]
< = jinja2-template-base
< = trafficserver-jinja2-template-base
template = ${template-trafficserver-records-config:location}/${template-trafficserver-records-config:filename}
rendered = $${trafficserver-directory:configuration}/records.config
mode = 700
filename = records.config
extra-context =
import os_module os
section ats_directory trafficserver-directory
section ats_configuration trafficserver-variable
[trafficserver-storage-config]
< = jinja2-template-base
< = trafficserver-jinja2-template-base
template = ${template-trafficserver-storage-config:location}/${template-trafficserver-storage-config:filename}
rendered = $${trafficserver-directory:configuration}/storage.config
mode = 700
extra-context =
section trafficserver trafficserver-variable
filename = storage.config
[trafficserver-remap-config]
< = jinja2-template-base
< = trafficserver-jinja2-template-base
template = ${template-empty:target}
rendered = $${trafficserver-configuration-directory:target}/remap.config
mode = 700
filename = remap.config
context =
key content trafficserver-variable:remap
[trafficserver-plugin-config]
< = jinja2-template-base
< = trafficserver-jinja2-template-base
template = ${template-empty:target}
rendered = $${trafficserver-configuration-directory:target}/plugin.config
mode = 700
filename = plugin.config
context =
key content trafficserver-variable:plugin-config
......
......@@ -331,7 +331,7 @@ CONFIG proxy.config.cache.permit.pinning INT 0
# default the ram cache size to AUTO_SIZE (-1) based on cache size
# (approximately 10 MB of RAM cache per GB of disk cache)
# alternatively, set to a fixed value such as 21474836480 (20GB)
CONFIG proxy.config.cache.ram_cache.size INT {{ slapparameter_dict.get('ram-cache-size', '1G') }}
CONFIG proxy.config.cache.ram_cache.size INT {{ ats_configuration.get('ram-cache-size', '1G') }}
# Replacement algorithm
# 0 : Clocked Least Frequently Used by Size (CLFUS) w/optional compression
# 1 : LRU w/o optional compression - trivially simple
......
{{ trafficserver.get("cache-path") }} {{ trafficserver.get("disk-cache-size") }} volume={{ trafficserver.get("hostname") }}
\ No newline at end of file
{{ ats_configuration.get("cache-path") }} {{ ats_configuration.get("disk-cache-size") }} volume={{ ats_configuration.get("hostname") }}
\ No newline at end of file
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