From b089a7feb406917dca619428469f19c00e6099f9 Mon Sep 17 00:00:00 2001 From: John Keates Date: Sun, 17 May 2015 18:26:08 +0200 Subject: [PATCH] Trying to fix the nesting mistake --- haproxy/templates/haproxy.jinja | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/haproxy/templates/haproxy.jinja b/haproxy/templates/haproxy.jinja index 04372cf..b306318 100644 --- a/haproxy/templates/haproxy.jinja +++ b/haproxy/templates/haproxy.jinja @@ -56,9 +56,10 @@ defaults {%- for frontend in salt['pillar.get']('haproxy:frontends', {}).iteritems() %} frontend {{ frontend[1].name }} bind {{ frontend[1].bind }} -{%- if 'redirects' in backend[1] %} -{%- for redirect in frontend[1].redirects %} -redirect {{ redirect }}{% endfor %} +{%- if 'redirects' in frontend[1] %} +{%- for front_redirect in frontend[1].redirects %} +redirect {{ front_redirect }} +{% endfor %} {-% endif %} {%- if 'acls' in frontend[1] %} {%- for acl in frontend[1].acls %} @@ -94,6 +95,6 @@ redirect {{ redirect }}{% endfor %} {%- if 'servers' in backend[1] %} {%- for server in backend[1].servers.iteritems() %} server {{ server[1].name }} {{ server[1].host }}:{{ server[1].port }} {{ server[1].check }}{% endfor %} - {% endif %} - {% endfor %} +{% endif %} +{% endfor %} {% endif %}