-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdefaults.jinja
30 lines (26 loc) · 1.1 KB
/
defaults.jinja
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{% load_yaml as defaults %}
listen_ip: "127.0.0.1" {# can be string or list of strings #}
listen_port: 3128
cache_dir: /var/cache/trafficserver
cache_size_mb: 10240 {# = 10GB disk cache size produces ~100mb ram cache size #}
{# memory_cache_size_mb: if not set: set between 10-200
cache_size_mb < 1024:
memory_cache_size_mb = 10
cache_size_mb > 1024 and cache_size_mb < 20480:
memory_cache_size_mb = cache_size_mb / 1024 * 10
cache_size_mb > 20480
memory_cache_size_mb = 200
#}
{% endload %}
{% set default_no_proxy = 'localhost,127.0.0.1,169.254.169.254,metadata.google.internal' %}
{% set settings=salt['grains.filter_by']({'none': defaults},
grain='none', default= 'none', merge= salt['pillar.get']('http_proxy_server', {})) %}
{% if settings.memory_cache_size_mb is not defined %}
{% set mem_mb = 10 %}
{% if settings.cache_size_mb > 1024 and settings.cache_size_mb < 20480 %}
{% set mem_mb = settings.cache_size_mb / 1024 * 10 %}
{% elif settings.cache_size_mb > 20480 %}
{% set mem_mb = 200 %}
{% endif %}
{% do settings.update({ 'memory_cache_size_mb': mem_mb }) %}
{% endif %}