From 15759e29d3b954739b2e1bda154ae00b8e4a4c19 Mon Sep 17 00:00:00 2001 From: Rowcliffe Browne Date: Fri, 6 Nov 2015 16:57:13 +0800 Subject: [PATCH] - added hash-type, monitor and monitor-uri to config template in respectively relevant sections --- haproxy/templates/haproxy.jinja | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/haproxy/templates/haproxy.jinja b/haproxy/templates/haproxy.jinja index 2c8303d..0806247 100644 --- a/haproxy/templates/haproxy.jinja +++ b/haproxy/templates/haproxy.jinja @@ -92,6 +92,10 @@ defaults mode {{ salt['pillar.get']('haproxy:defaults:mode', 'http') }} retries {{ salt['pillar.get']('haproxy:defaults:retries', '3') }} 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', {}) -%} {{- render_list_of_dictionaries('option', salt['pillar.get']('haproxy:defaults:options')) }} {%- endif %} @@ -155,6 +159,9 @@ listen {{ listener[1].get('name', listener[0]) }} {%- if 'mode' in listener[1] %} mode {{ listener[1].mode }} {%- endif %} + {%- if 'hashtype' in listener[1] %} + hash-type {{ listener[1].hashtype }} + {%- endif %} {%- if 'logformat' in listener[1] %} log-format {{ listener[1].logformat }} {%- endif %} @@ -185,6 +192,12 @@ listen {{ listener[1].get('name', listener[0]) }} {%- endfor %} {%- 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 listener[1].tcprequests is string %} tcp-request {{ listner[1].tcprequests }} @@ -212,6 +225,11 @@ listen {{ listener[1].get('name', listener[0]) }} {%- endfor %} {%- 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 listener[1].reqadds is string %} reqadd {{ listener[1].reqadds }} @@ -335,6 +353,12 @@ frontend {{ frontend[1].get('name', frontend[0]) }} {%- if 'acls' in frontend[1] %} {{- render_list_of_dictionaries('acl', frontend[1].acls) }} {%- 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] %} {{- render_list_of_dictionaries('tcp-request', frontend[1].tcprequests) }} {%- endif %} @@ -377,6 +401,9 @@ backend {{ backend[1].get('name',backend[0]) }} {%- if 'mode' in backend[1] %} mode {{ backend[1].mode }} {%- endif %} + {%- if 'hashtype' in backend[1] %} + hash-type {{ backend[1].hashtype }} + {%- endif %} {%- if 'balance' in backend[1] %} balance {{ backend[1].balance }} {%- endif %} @@ -422,6 +449,11 @@ backend {{ backend[1].get('name',backend[0]) }} {%- endfor %} {%- 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 backend[1].redirects is string %} redirect {{ backend[1].redirects }}