- added hash-type, monitor and monitor-uri to config template in respectively relevant sections

This commit is contained in:
Rowcliffe Browne 2015-11-06 16:57:13 +08:00
parent 03e3c7beae
commit 15759e29d3

View file

@ -92,6 +92,10 @@ defaults
mode {{ salt['pillar.get']('haproxy:defaults:mode', 'http') }} mode {{ salt['pillar.get']('haproxy:defaults:mode', 'http') }}
retries {{ salt['pillar.get']('haproxy:defaults:retries', '3') }} 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 'monitoruri' in salt['pillar.get']('haproxy:defaults', {}) -%}
monitor-uri {{ salt['pillar.get']('haproxy:defaults:monitoruri') }}
{%- endif %}
hash-type {{ salt['pillar.get']('haproxy:defaults:hashtype', 'map-based') }}
{%- 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 %}
@ -155,6 +159,9 @@ listen {{ listener[1].get('name', listener[0]) }}
{%- if 'mode' in listener[1] %} {%- if 'mode' in listener[1] %}
mode {{ listener[1].mode }} mode {{ listener[1].mode }}
{%- endif %} {%- endif %}
{%- if 'hashtype' in listener[1] %}
hash-type {{ listener[1].hashtype }}
{%- endif %}
{%- if 'logformat' in listener[1] %} {%- if 'logformat' in listener[1] %}
log-format {{ listener[1].logformat }} log-format {{ listener[1].logformat }}
{%- endif %} {%- endif %}
@ -185,6 +192,12 @@ listen {{ listener[1].get('name', listener[0]) }}
{%- endfor %} {%- endfor %}
{%- endif %} {%- endif %}
{%- endif %} {%- endif %}
{%- if 'monitoruri' in listener[1] %}
monitor-uri {{ listener[1].monitoruri }}
{%- endif %}
{%- if 'monitor' in listener[1] %}
monitor {{ listener[1].monitor }}
{%- endif %}
{%- if 'tcprequests' in listener[1] %} {%- if 'tcprequests' in listener[1] %}
{%- if listener[1].tcprequests is string %} {%- if listener[1].tcprequests is string %}
tcp-request {{ listner[1].tcprequests }} tcp-request {{ listner[1].tcprequests }}
@ -212,6 +225,11 @@ listen {{ listener[1].get('name', listener[0]) }}
{%- endfor %} {%- endfor %}
{%- endif %} {%- endif %}
{%- endif %} {%- endif %}
{%- if 'httpcheck' in listener[1] %}
{%- if listener[1].httpcheck is string %}
http-check {{ listener[1].httpcheck }}
{%- endif %}
{%- endif %}
{%- if 'reqadds' in listener[1] %} {%- if 'reqadds' in listener[1] %}
{%- if listener[1].reqadds is string %} {%- if listener[1].reqadds is string %}
reqadd {{ listener[1].reqadds }} reqadd {{ listener[1].reqadds }}
@ -335,6 +353,12 @@ frontend {{ frontend[1].get('name', frontend[0]) }}
{%- if 'acls' in frontend[1] %} {%- if 'acls' in frontend[1] %}
{{- render_list_of_dictionaries('acl', frontend[1].acls) }} {{- render_list_of_dictionaries('acl', frontend[1].acls) }}
{%- endif %} {%- endif %}
{%- if 'monitoruri' in frontend[1] %}
monitor-uri {{ frontend[1].monitoruri }}
{%- endif %}
{%- if 'monitor' in frontend[1] %}
monitor {{ frontend[1].monitor }}
{%- endif %}
{%- if 'tcprequests' in frontend[1] %} {%- if 'tcprequests' in frontend[1] %}
{{- render_list_of_dictionaries('tcp-request', frontend[1].tcprequests) }} {{- render_list_of_dictionaries('tcp-request', frontend[1].tcprequests) }}
{%- endif %} {%- endif %}
@ -377,6 +401,9 @@ backend {{ backend[1].get('name',backend[0]) }}
{%- if 'mode' in backend[1] %} {%- if 'mode' in backend[1] %}
mode {{ backend[1].mode }} mode {{ backend[1].mode }}
{%- endif %} {%- endif %}
{%- if 'hashtype' in backend[1] %}
hash-type {{ backend[1].hashtype }}
{%- endif %}
{%- if 'balance' in backend[1] %} {%- if 'balance' in backend[1] %}
balance {{ backend[1].balance }} balance {{ backend[1].balance }}
{%- endif %} {%- endif %}
@ -422,6 +449,11 @@ backend {{ backend[1].get('name',backend[0]) }}
{%- endfor %} {%- endfor %}
{%- endif %} {%- endif %}
{%- endif %} {%- endif %}
{%- if 'httpcheck' in backend[1] %}
{%- if backend[1].httpcheck is string %}
http-check {{ backend[1].httpcheck }}
{%- endif %}
{%- endif %}
{%- if 'redirects' in backend[1] %} {%- if 'redirects' in backend[1] %}
{%- if backend[1].redirects is string %} {%- if backend[1].redirects is string %}
redirect {{ backend[1].redirects }} redirect {{ backend[1].redirects }}