adds some default values for essential params
With this PR the haproxy.config state will actually render a valid haproxy.cfg from default values, even when the values are not explicitely passed via the pillar. Right now, an invalid cfg is generated which breaks haproxy on startup.
This commit is contained in:
parent
b83deb4f28
commit
267e27680a
1 changed files with 8 additions and 4 deletions
|
@ -31,9 +31,9 @@ global
|
||||||
# use- if not designated in their block
|
# use- if not designated in their block
|
||||||
#------------------
|
#------------------
|
||||||
defaults
|
defaults
|
||||||
log {{ salt['pillar.get']('haproxy:defaults:log') }}
|
log {{ salt['pillar.get']('haproxy:defaults:log', 'global')}}
|
||||||
mode {{ salt['pillar.get']('haproxy:defaults:mode') }}
|
mode {{ salt['pillar.get']('haproxy:defaults:mode', 'http') }}
|
||||||
retries {{ salt['pillar.get']('haproxy:defaults:retries') }}
|
retries {{ salt['pillar.get']('haproxy:defaults:retries', '3') }}
|
||||||
balance {{ salt['pillar.get']('haproxy:defaults:balance', 'roundrobin') }}
|
balance {{ salt['pillar.get']('haproxy:defaults:balance', 'roundrobin') }}
|
||||||
{%- if 'options' in salt['pillar.get']('haproxy:defaults', {}) %}
|
{%- if 'options' in salt['pillar.get']('haproxy:defaults', {}) %}
|
||||||
{%- for option in salt['pillar.get']('haproxy:defaults:options') %}
|
{%- for option in salt['pillar.get']('haproxy:defaults:options') %}
|
||||||
|
@ -44,7 +44,11 @@ defaults
|
||||||
{%- for timeout in salt['pillar.get']('haproxy:defaults:timeouts') %}
|
{%- for timeout in salt['pillar.get']('haproxy:defaults:timeouts') %}
|
||||||
timeout {{ timeout }}
|
timeout {{ timeout }}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
{% endif %}
|
{%- else %}
|
||||||
|
timeout client 1m
|
||||||
|
timeout connect 10s
|
||||||
|
timeout server 1m
|
||||||
|
{%- endif %}
|
||||||
{%- if 'errorfiles' in salt['pillar.get']('haproxy:defaults', {}) %}
|
{%- if 'errorfiles' in salt['pillar.get']('haproxy:defaults', {}) %}
|
||||||
{%- for errorfile in salt['pillar.get']('haproxy:defaults:errorfiles').iteritems() %}
|
{%- for errorfile in salt['pillar.get']('haproxy:defaults:errorfiles').iteritems() %}
|
||||||
errorfile {{ errorfile[0] }} {{ errorfile[1] }}
|
errorfile {{ errorfile[0] }} {{ errorfile[1] }}
|
||||||
|
|
Loading…
Reference in a new issue