paulbsd-salt/states/haproxy/templates/spoe.cfg.j2
2023-03-10 00:02:52 +01:00

25 lines
831 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 }}
log global
timeout hello {{ values.timeout_hello|default("2s") }}
timeout idle {{ values.timeout_idle|default("2m") }}
timeout processing {{ values.timeout_processing|default("300ms") }}
use-backend {{ name }}
{% for name, values in values.messages.items() -%}
spoe-message {{ name }}
{%- if values.args.keys()|length > 0 %}
args {% for i, v in values.args.items() %}{{ "{}={}".format(i,v) }} {% endfor %}
{%- endif %}
{%- if values.event %}
event {{ values.event }}
{%- endif %}
{% endfor -%}
{% endfor -%}