make haproxy.cfg template more modular
This commit is contained in:
parent
0d2b72c138
commit
51b66a91ca
1 changed files with 8 additions and 0 deletions
|
@ -89,13 +89,21 @@ userlist {{ id }}
|
||||||
#------------------
|
#------------------
|
||||||
defaults
|
defaults
|
||||||
log {{ salt['pillar.get']('haproxy:defaults:log', 'global') }}
|
log {{ salt['pillar.get']('haproxy:defaults:log', 'global') }}
|
||||||
|
{%- if 'mode' in salt['pillar.get']('haproxy:defaults', {}) -%}
|
||||||
mode {{ salt['pillar.get']('haproxy:defaults:mode', 'http') }}
|
mode {{ salt['pillar.get']('haproxy:defaults:mode', 'http') }}
|
||||||
|
{%- endif %}
|
||||||
|
{%- if 'retries' in salt['pillar.get']('haproxy:defaults', {}) -%}
|
||||||
retries {{ salt['pillar.get']('haproxy:defaults:retries', '3') }}
|
retries {{ salt['pillar.get']('haproxy:defaults:retries', '3') }}
|
||||||
|
{%- endif %}
|
||||||
|
{%- if 'balance' in salt['pillar.get']('haproxy:defaults', {}) -%}
|
||||||
balance {{ salt['pillar.get']('haproxy:defaults:balance', 'roundrobin') }}
|
balance {{ salt['pillar.get']('haproxy:defaults:balance', 'roundrobin') }}
|
||||||
|
{%- endif %}
|
||||||
{%- if 'monitoruri' in salt['pillar.get']('haproxy:defaults', {}) -%}
|
{%- if 'monitoruri' in salt['pillar.get']('haproxy:defaults', {}) -%}
|
||||||
monitor-uri {{ salt['pillar.get']('haproxy:defaults:monitoruri') }}
|
monitor-uri {{ salt['pillar.get']('haproxy:defaults:monitoruri') }}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- if 'hashtype' in salt['pillar.get']('haproxy:defaults', {}) -%}
|
||||||
hash-type {{ salt['pillar.get']('haproxy:defaults:hashtype', 'map-based') }}
|
hash-type {{ salt['pillar.get']('haproxy:defaults:hashtype', 'map-based') }}
|
||||||
|
{%- endif %}
|
||||||
{%- if 'options' in salt['pillar.get']('haproxy:defaults', {}) -%}
|
{%- if 'options' in salt['pillar.get']('haproxy:defaults', {}) -%}
|
||||||
{{- render_list_of_dictionaries('option', salt['pillar.get']('haproxy:defaults:options')) }}
|
{{- render_list_of_dictionaries('option', salt['pillar.get']('haproxy:defaults:options')) }}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
Loading…
Reference in a new issue