From 41e38d36e8cf0b21cfb148ca30675f840996471f Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Wed, 17 May 2023 13:20:14 +0200 Subject: [PATCH] updated haproxy state --- states/haproxy/defaults.yaml | 3 ++- states/haproxy/templates/haproxy.cfg.j2 | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/states/haproxy/defaults.yaml b/states/haproxy/defaults.yaml index 28c051b..aeee366 100644 --- a/states/haproxy/defaults.yaml +++ b/states/haproxy/defaults.yaml @@ -91,12 +91,13 @@ haproxy: ssl_options: - no-sslv3 - no-tls-tickets - gzip_mime_types: + compression_mime_types: - text/html - text/plain - text/css - text/javascript - application/json + - application/octet-stream cache: size: 50000 file_types: diff --git a/states/haproxy/templates/haproxy.cfg.j2 b/states/haproxy/templates/haproxy.cfg.j2 index e86b22e..a6eac40 100644 --- a/states/haproxy/templates/haproxy.cfg.j2 +++ b/states/haproxy/templates/haproxy.cfg.j2 @@ -24,7 +24,7 @@ {%- macro httpendpoints(servers=[], check=True, disabled=False) -%} {%- for server in servers %} - server {{ server.name }} {{ server.name }}:{{ server.port }}{{ " " + httpcheckrules(inter=server.inter|default("2s"), fall=server.fall|default(5), rise=server.rise|default(5)) if check }}{{ " " + httpsslrules() if server.ssl|default(False) }}{{ " disabled" if server.disabled|default(False) }}{{ " send-proxy" if server.proxy|default(False) }}{{ " on-marked-down shutdown-sessions" if server.killsessions|default(False) }} + server {{ server.name }} {{ server.name }}:{{ server.port }}{{ " " + httpcheckrules(inter=server.inter|default("2s"), fall=server.fall|default(5), rise=server.rise|default(5)) if check }}{{ " " + httpsslrules() if server.ssl|default(False) }}{{ " disabled" if server.disabled|default(False) }}{{ " send-proxy" if server.proxy|default(False) }}{{ " on-marked-down shutdown-sessions on-marked-up shutdown-backup-sessions" if server.killsessions|default(False) }} {%- endfor %} {%- endmacro -%} @@ -41,7 +41,7 @@ {%- macro compression() -%} compression algo gzip - compression type {{ haproxy.config.gzip_mime_types|join(' ') }} + compression type {{ haproxy.config.compression_mime_types|join(' ') }} {%- endmacro -%} {%- macro admin() -%} @@ -50,7 +50,7 @@ backend admin from {{ haproxy.config.namespace }} mode http stats enable stats admin if TRUE - stats refresh 10s + #stats refresh 10s stats show-modules stats show-legends stats uri /