Change formatting options, add request handler
This commit is contained in:
parent
df2c761cd8
commit
eb4175413e
1 changed files with 5 additions and 0 deletions
|
@ -51,6 +51,7 @@ 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
|
# 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') %}
|
||||||
|
@ -80,18 +81,21 @@ 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
|
# 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
|
# 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
|
# frontend http-requests
|
||||||
{%- if 'http_requests' in frontend[1] %}
|
{%- if 'http_requests' in frontend[1] %}
|
||||||
{%- for http_request in frontend[1].http_requests %}
|
{%- for http_request in frontend[1].http_requests %}
|
||||||
|
@ -105,6 +109,7 @@ http-request {{ http_request }}
|
||||||
reqadd {{ reqadd }}
|
reqadd {{ reqadd }}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
# backend targets
|
# 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] -%}
|
||||||
|
|
Loading…
Reference in a new issue