Files
configpolicy/roles/haproxy/templates/global.cfg.j2
Dustin C. Hatch 7b6e0bd100 r/haproxy: Support configuring resolvers
HAProxy uses a special configuration block, `resolvers`, to specify
how it should look up names in DNS.  This configuration is used for
e.g. dynamically discovering backend servers via DNS A or SRV records.
Since resolvers are global, they need to be specified in the global
configuration file, rather than a per-application drop-in.

We will use this functionality for the ACME HTTP-01 challenge solver
for Samba AD domain controllers.
2024-06-12 18:29:56 -05:00

36 lines
1.1 KiB
Django/Jinja

#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
log /dev/log local0
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
# turn on stats unix socket
stats socket /var/lib/haproxy/stats
# utilize system-wide crypto-policies
ssl-default-bind-ciphers {{ haproxy_ssl_default_ciphers }}
{% if haproxy_ssl_default_server_ciphers|d %}
ssl-default-server-ciphers {{ haproxy_ssl_default_server_ciphers }}
{% endif %}
{% if haproxy_ssl_default_bind_options|d %}
ssl-default-bind-options {{ haproxy_ssl_default_bind_options }}
{% endif %}
{% if haproxy_resolvers|d %}
{% for resolver in haproxy_resolvers %}
resolvers {{ resolver.name }}
{% for nameserver in resolver.nameservers %}
nameserver {{ nameserver.name }} {{ nameserver.address }}
{% endfor %}
{% for key, value in resolver.options|dictsort %}
{{ key }} {{ value }}
{% endfor %}
{% endfor %}
{% endif %}