diff --git a/README.md b/README.md index 58c27e8..1b1b2fd 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,11 @@ haproxy_stats_options: - hide-version haproxy_stats_listener_options: - dontlog-normal +haproxy_stats_timeouts: + - client 100s + - server 100s + - connect 100s + - queue 100s # SSL haproxy_ssl_certificate: /etc/ssl/uoi.io/uoi.io.pem diff --git a/defaults/main.yml b/defaults/main.yml index 86e142a..178fc6a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -98,6 +98,11 @@ haproxy_stats_options: - show-node - hide-version haproxy_stats_listener_options: [] +haproxy_stats_timeouts: + - client 100s + - server 100s + - connect 100s + - queue 100s # SSL haproxy_ssl_certificate: /etc/ssl/uoi.io/uoi.io.pem diff --git a/templates/etc/haproxy/haproxy-stats.cfg.j2 b/templates/etc/haproxy/haproxy-stats.cfg.j2 index 25f55a4..0c69005 100644 --- a/templates/etc/haproxy/haproxy-stats.cfg.j2 +++ b/templates/etc/haproxy/haproxy-stats.cfg.j2 @@ -22,8 +22,9 @@ listen stats {% for listener_opt in haproxy_stats_listener_options %} option {{ listener_opt }} {% endfor %} - timeout client 100s - timeout server 100s - timeout connect 100s - timeout queue 100s +{% if haproxy_stats_timeouts is defined and haproxy_stats_timeouts|length %} + {% for timeout in haproxy_stats_timeouts %} + timeout {{ timeout }} + {% endfor %} +{% endif %} {% endif %}