31 lines
971 B
Django/Jinja
31 lines
971 B
Django/Jinja
## {{ salt['pillar.get']('salt_managed', default='Salt Managed') }}
|
|
{%- from "haproxy/map.jinja" import haproxy with context %}
|
|
|
|
{%- for name, values in haproxy.config.spoe.items() %}
|
|
[{{ name }}]
|
|
spoe-agent {{ name }}
|
|
messages {{ " ".join(values.messages.keys()) }} option var-prefix {{ name }}
|
|
timeout hello 2s
|
|
timeout idle 2m
|
|
timeout processing 50ms
|
|
use-backend {{ name }}
|
|
log global
|
|
|
|
{%- for m, m_values in values.messages.items() %}
|
|
spoe-message {{ m }}
|
|
{%- if m_values.args.keys() > 0 %}
|
|
args {{ " ".join([i+"="+v for i, v in m_values.args.items()]) }}
|
|
{%- endif %}
|
|
{%- if m_values.event %}
|
|
event {{ m_values.event }}
|
|
{%- endif %}
|
|
{% endfor %}
|
|
|
|
spoe-message request
|
|
args unique_id=unique-id clientip=src host=req.hdr(Host) method=method path=pathq headers=req.hdrs body_size=req.body_size body=req.body
|
|
event on-frontend-http-request
|
|
spoe-message response
|
|
args unique_id=unique-id status=status
|
|
event on-http-response
|
|
{% endfor -%}
|