Trying to fix the nesting mistake

This commit is contained in:
John Keates 2015-05-17 18:26:08 +02:00
parent 454c5ba973
commit b089a7feb4

View file

@ -56,9 +56,10 @@ defaults
{%- for frontend in salt['pillar.get']('haproxy:frontends', {}).iteritems() %} {%- for frontend in salt['pillar.get']('haproxy:frontends', {}).iteritems() %}
frontend {{ frontend[1].name }} frontend {{ frontend[1].name }}
bind {{ frontend[1].bind }} bind {{ frontend[1].bind }}
{%- if 'redirects' in backend[1] %} {%- if 'redirects' in frontend[1] %}
{%- for redirect in frontend[1].redirects %} {%- for front_redirect in frontend[1].redirects %}
redirect {{ redirect }}{% endfor %} redirect {{ front_redirect }}
{% endfor %}
{-% endif %} {-% endif %}
{%- if 'acls' in frontend[1] %} {%- if 'acls' in frontend[1] %}
{%- for acl in frontend[1].acls %} {%- for acl in frontend[1].acls %}
@ -94,6 +95,6 @@ redirect {{ redirect }}{% endfor %}
{%- if 'servers' in backend[1] %} {%- if 'servers' in backend[1] %}
{%- for server in backend[1].servers.iteritems() %} {%- for server in backend[1].servers.iteritems() %}
server {{ server[1].name }} {{ server[1].host }}:{{ server[1].port }} {{ server[1].check }}{% endfor %} server {{ server[1].name }} {{ server[1].host }}:{{ server[1].port }} {{ server[1].check }}{% endfor %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}