From ad67cf1ccb63d4ef6e846c167ca0fa57ed7b6e2b Mon Sep 17 00:00:00 2001 From: Bjarne Lindow Date: Mon, 30 May 2022 09:48:43 +0200 Subject: [PATCH] Moved stats timeouts to variable --- README.md | 5 +++++ defaults/main.yml | 5 +++++ templates/etc/haproxy/haproxy-stats.cfg.j2 | 9 +++++---- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f707ffe..2ffb9a8 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,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 %}