From 6c588e41b47e3f3c10648233bcad6e201203566b Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Wed, 10 Jan 2018 13:14:15 -0600 Subject: [PATCH] Make haproxy stats refresh interval configurable This patch adds a new variable, ``haproxy_stats_refresh_interval``, which allows a deployer to configure their preferred refresh interval for the haproxy stats page. Release notes are included. Closes-Bug: 1742526 Change-Id: I3979299478a8e9b479a4c4e821f2a45e1b2679cb --- defaults/main.yml | 1 + ...resh-interval-configuration-option-884d64aa259ecc3c.yaml | 6 ++++++ templates/haproxy.cfg.j2 | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/refresh-interval-configuration-option-884d64aa259ecc3c.yaml diff --git a/defaults/main.yml b/defaults/main.yml index e665bc6..55ee346 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -32,6 +32,7 @@ haproxy_stats_bind_address: 127.0.0.1 haproxy_stats_port: 1936 haproxy_username: admin haproxy_stats_password: secrete +haproxy_stats_refresh_interval: 60 # Default haproxy backup nodes to empty list so this doesn't have to be # defined for each service. diff --git a/releasenotes/notes/refresh-interval-configuration-option-884d64aa259ecc3c.yaml b/releasenotes/notes/refresh-interval-configuration-option-884d64aa259ecc3c.yaml new file mode 100644 index 0000000..5f0a861 --- /dev/null +++ b/releasenotes/notes/refresh-interval-configuration-option-884d64aa259ecc3c.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Deployers can set a refresh interval for haproxy's stats page by setting + the ``haproxy_stats_refresh_interval`` variable. The default value is + ``60``, which causes haproxy to refresh the stats page every 60 seconds. diff --git a/templates/haproxy.cfg.j2 b/templates/haproxy.cfg.j2 index fd669bd..1ffbf68 100644 --- a/templates/haproxy.cfg.j2 +++ b/templates/haproxy.cfg.j2 @@ -48,5 +48,5 @@ listen stats stats show-legends stats auth {{ haproxy_username }}:{{ haproxy_stats_password }} stats admin if TRUE - stats refresh 60s + stats refresh {{ haproxy_stats_refresh_interval }}s {% endif %}