From eb4175413eb1391607180c3f4d8f77c45fb99024 Mon Sep 17 00:00:00 2001 From: John Keates Date: Fri, 31 Jul 2015 00:24:58 +0200 Subject: [PATCH] Change formatting options, add request handler --- haproxy/templates/haproxy.jinja | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/haproxy/templates/haproxy.jinja b/haproxy/templates/haproxy.jinja index d303d44..2843d38 100644 --- a/haproxy/templates/haproxy.jinja +++ b/haproxy/templates/haproxy.jinja @@ -51,6 +51,7 @@ defaults log {{ salt['pillar.get']('haproxy:defaults:log') }} mode {{ salt['pillar.get']('haproxy:defaults:mode') }} retries {{ salt['pillar.get']('haproxy:defaults:retries') }} + # options {%- if 'options' in salt['pillar.get']('haproxy:defaults', {}) %} {%- for option in salt['pillar.get']('haproxy:defaults:options') %} @@ -80,18 +81,21 @@ defaults {%- for frontend in salt['pillar.get']('haproxy:frontends', {}).iteritems() %} frontend {{ frontend[1].name }} bind {{ frontend[1].bind }} + # frontend redirects {%- if 'redirects' in frontend[1] %} {%- for front_redirect in frontend[1].redirects %} redirect {{ front_redirect }} {% endfor %} {%- endif %} + # frontend acls {%- if 'acls' in frontend[1] %} {%- for acl in frontend[1].acls %} acl {{ acl }} {%- endfor %} {%- endif %} + # frontend http-requests {%- if 'http_requests' in frontend[1] %} {%- for http_request in frontend[1].http_requests %} @@ -105,6 +109,7 @@ http-request {{ http_request }} reqadd {{ reqadd }} {%- endfor %} {%- endif %} + # backend targets default_backend {{ frontend[1].default_backend }} {%-if 'use_backends' in frontend[1] -%}