paulbsd-salt/states/haproxy/templates/spoe.cfg.j2

25 lines
831 B
Plaintext
Raw Normal View History

2022-12-11 16:34:27 +01:00
## {{ salt['pillar.get']('salt_managed', default='Salt Managed') }}
{%- from "haproxy/map.jinja" import haproxy with context %}
2023-02-04 19:51:20 +01:00
{% for name, values in haproxy.config.spoe.items() -%}
2022-12-11 16:34:27 +01:00
[{{ name }}]
spoe-agent {{ name }}
2023-02-04 19:51:20 +01:00
messages {{ " ".join(values.messages.keys()) }}
option var-prefix {{ name }}
2022-12-11 16:34:27 +01:00
log global
2023-02-04 19:51:20 +01:00
timeout hello {{ values.timeout_hello|default("2s") }}
timeout idle {{ values.timeout_idle|default("2m") }}
timeout processing {{ values.timeout_processing|default("300ms") }}
use-backend {{ name }}
2022-12-11 16:34:27 +01:00
2023-03-10 00:02:52 +01:00
{% 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 %}
2023-02-04 19:51:20 +01:00
{%- endif %}
2023-03-10 00:02:52 +01:00
{%- if values.event %}
event {{ values.event }}
2023-02-04 19:51:20 +01:00
{%- endif %}
{% endfor -%}
{% endfor -%}