Add more detailed comments

This commit is contained in:
John Keates 2015-07-31 00:14:36 +02:00
parent 86cf6b1a09
commit df2c761cd8

View file

@ -51,16 +51,19 @@ defaults
log {{ salt['pillar.get']('haproxy:defaults:log') }} log {{ salt['pillar.get']('haproxy:defaults:log') }}
mode {{ salt['pillar.get']('haproxy:defaults:mode') }} mode {{ salt['pillar.get']('haproxy:defaults:mode') }}
retries {{ salt['pillar.get']('haproxy:defaults:retries') }} retries {{ salt['pillar.get']('haproxy:defaults:retries') }}
# options
{%- if 'options' in salt['pillar.get']('haproxy:defaults', {}) %} {%- if 'options' in salt['pillar.get']('haproxy:defaults', {}) %}
{%- for option in salt['pillar.get']('haproxy:defaults:options') %} {%- for option in salt['pillar.get']('haproxy:defaults:options') %}
option {{ option }} option {{ option }}
{%- endfor %} {%- endfor %}
{% endif %} {% endif %}
# timeouts
{%- if 'timeouts' in salt['pillar.get']('haproxy:defaults', {}) %} {%- if 'timeouts' in salt['pillar.get']('haproxy:defaults', {}) %}
{%- for timeout in salt['pillar.get']('haproxy:defaults:timeouts') %} {%- for timeout in salt['pillar.get']('haproxy:defaults:timeouts') %}
timeout {{ timeout }} timeout {{ timeout }}
{%- endfor %} {%- endfor %}
{% endif %} {% endif %}
# errorfiles
{%- if 'errorfiles' in salt['pillar.get']('haproxy:defaults', {}) %} {%- if 'errorfiles' in salt['pillar.get']('haproxy:defaults', {}) %}
{%- for errorfile in salt['pillar.get']('haproxy:defaults:errorfiles').iteritems() %} {%- for errorfile in salt['pillar.get']('haproxy:defaults:errorfiles').iteritems() %}
errorfile {{ errorfile[0] }} {{ errorfile[1] }} errorfile {{ errorfile[0] }} {{ errorfile[1] }}
@ -77,21 +80,32 @@ 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 }}
# frontend redirects
{%- if 'redirects' in frontend[1] %} {%- if 'redirects' in frontend[1] %}
{%- for front_redirect in frontend[1].redirects %} {%- for front_redirect in frontend[1].redirects %}
redirect {{ front_redirect }} redirect {{ front_redirect }}
{% endfor %} {% endfor %}
{%- endif %} {%- endif %}
# frontend acls
{%- if 'acls' in frontend[1] %} {%- if 'acls' in frontend[1] %}
{%- for acl in frontend[1].acls %} {%- for acl in frontend[1].acls %}
acl {{ acl }} acl {{ acl }}
{%- endfor %} {%- endfor %}
{%- endif %} {%- endif %}
# frontend http-requests
{%- if 'http_requests' in frontend[1] %}
{%- for http_request in frontend[1].http_requests %}
http-request {{ http_request }}
{% endfor %}
{%- endif %}
# frontend reqadds
{%- if 'reqadd' in frontend[1] %} {%- if 'reqadd' in frontend[1] %}
{%- for reqadd in frontend[1].reqadd %} {%- for reqadd in frontend[1].reqadd %}
reqadd {{ reqadd }} reqadd {{ reqadd }}
{%- endfor %} {%- endfor %}
{%- endif %} {%- endif %}
# backend targets
default_backend {{ frontend[1].default_backend }} default_backend {{ frontend[1].default_backend }}
{%-if 'use_backends' in frontend[1] -%} {%-if 'use_backends' in frontend[1] -%}
{%- for use_backend in frontend[1].use_backends %} {%- for use_backend in frontend[1].use_backends %}
@ -111,6 +125,16 @@ backend {{ backend[1].name }}
{%- if 'redirects' in backend[1] %} {%- if 'redirects' in backend[1] %}
{%- for redirect in backend[1].redirects %} # Redirect loop start {%- for redirect in backend[1].redirects %} # Redirect loop start
redirect {{ redirect }}{% endfor %} redirect {{ redirect }}{% endfor %}
{%- endif %}
{%- if 'http_requests' in backend[1] %}
{%- for http_request in backend[1].http_requests %}
http-request {{ http_request }}
{% endfor %}
{%- endif %}
{%- if 'acls' in backend[1] %}
{%- for acl in backend[1].acls %}
acl {{ acl }}
{%- endfor %}
{%- endif %} {%- endif %}
balance {{ backend[1].balance }} balance {{ backend[1].balance }}
{%- if 'options' in backend[1] %} {%- if 'options' in backend[1] %}