From dd248a23e6b44606e0602e16407e723a4ad5a210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ro=C3=9Fdeutscher?= Date: Mon, 7 Sep 2015 16:30:14 +0200 Subject: [PATCH 1/3] add ca-base, crt-base and tune.ssl.default-dh-param properties to global part --- haproxy/templates/haproxy.jinja | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/haproxy/templates/haproxy.jinja b/haproxy/templates/haproxy.jinja index 7c9123a..e5a95b8 100644 --- a/haproxy/templates/haproxy.jinja +++ b/haproxy/templates/haproxy.jinja @@ -48,6 +48,15 @@ global {%- if 'tune' in salt['pillar.get']('haproxy:global', {}) %} {{- render_list_of_dictionaries('tune', salt['pillar.get']('haproxy:global:tune'), ' ','.') }} {%- endif %} +{%- if 'tune.ssl.default-dh-param' in salt['pillar.get']('haproxy:global', {}) %} + {{- render_list_of_dictionaries('tune.ssl.default-dh-param', salt['pillar.get']('haproxy:global:tune.ssl.default-dh-param'), ' ','.') }} +{%- endif %} +{%- if 'ca-base' in salt['pillar.get']('haproxy:global', {}) %} + {{- render_list_of_dictionaries('ca-base', salt['pillar.get']('haproxy:global:ca-base'), ' ','.') }} +{%- endif %} +{%- if 'crt-base' in salt['pillar.get']('haproxy:global', {}) %} + {{- render_list_of_dictionaries('crt-base', salt['pillar.get']('haproxy:global:crt-base'), ' ','.') }} +{%- endif %} {%- if 'ssl-default-bind-ciphers' in salt['pillar.get']('haproxy:global', {}) %} {{- render_list_of_dictionaries('ssl-default-bind-ciphers', salt['pillar.get']('haproxy:global:ssl-default-bind-ciphers')) }} {%- endif %} From a6545fe434a90c043892d82f91835a98059d03aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ro=C3=9Fdeutscher?= Date: Mon, 7 Sep 2015 16:46:56 +0200 Subject: [PATCH 2/3] fix option keyword in frontends section when iterating over frontend options --- haproxy/templates/haproxy.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haproxy/templates/haproxy.jinja b/haproxy/templates/haproxy.jinja index e5a95b8..1a06cf5 100644 --- a/haproxy/templates/haproxy.jinja +++ b/haproxy/templates/haproxy.jinja @@ -309,7 +309,7 @@ frontend {{ frontend[1].get('name', frontend[0]) }} maxconn {{ frontend[1].maxconn }} {%- endif %} {%- if 'options' in frontend[1] %} - {{- render_list_of_dictionaries('options', frontend[1].options) }} + {{- render_list_of_dictionaries('option', frontend[1].options) }} {%- endif %} {%- if 'uniqueidformat' in frontend[1] %} unique-id-format {{ frontend[1].uniqueidformat }} From 677d6b2aac9773e4c86309ea67d8b0a8c18fd184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ro=C3=9Fdeutscher?= Date: Tue, 8 Sep 2015 15:41:28 +0200 Subject: [PATCH 3/3] add sort filter to listen and backend directives in haproxy.conf --- haproxy/templates/haproxy.jinja | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/haproxy/templates/haproxy.jinja b/haproxy/templates/haproxy.jinja index 1a06cf5..bfe89a2 100644 --- a/haproxy/templates/haproxy.jinja +++ b/haproxy/templates/haproxy.jinja @@ -283,7 +283,7 @@ listen {{ listener[1].get('name', listener[0]) }} default-server {%- for option, value in listener[1].defaultserver.iteritems() %} {{ ' '.join((option, value|string, '')) }} {%- endfor %} {%- endif %} {%- if 'servers' in listener[1] %} - {%- for server in listener[1].servers.iteritems() %} + {%- for server in listener[1].servers.iteritems()|sort %} server {{ server[1].get('name',server[0]) }} {{ server[1].host }}:{{ server[1].port }} {{ server[1].check }} {{ server[1].get('extra', '') }} {%- endfor %} {%- endif %} @@ -457,7 +457,7 @@ backend {{ backend[1].get('name',backend[0]) }} default-server {%- for option, value in backend[1].defaultserver.iteritems() %} {{ ' '.join((option, value|string, '')) }} {%- endfor %} {%- endif %} {%- if 'servers' in backend[1] %} - {%- for server in backend[1].servers.iteritems() %} + {%- for server in backend[1].servers.iteritems()|sort %} server {{ server[1].get('name',server[0]) }} {{ server[1].host }}:{{ server[1].port }} {{ server[1].check }} {{ server[1].get('extra', '') }} {%- endfor %} {%- endif %}