From 91a12a93a39fa1f3d431be78b8a0a34098fba4c7 Mon Sep 17 00:00:00 2001 From: geywitz Date: Thu, 27 Jul 2023 16:28:54 +0200 Subject: [PATCH] Make unique-id-format configurable --- README.md | 1 + defaults/main.yml | 1 + templates/etc/haproxy/haproxy-default.cfg.j2 | 3 +++ templates/etc/haproxy/haproxy-frontend.cfg.j2 | 3 +++ templates/etc/haproxy/haproxy-listen.cfg.j2 | 3 +++ 5 files changed, 11 insertions(+) diff --git a/README.md b/README.md index 49592d8..f35c01c 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,7 @@ haproxy_default_errorfiles: - "403 {{ haproxy_errors_directory }}/403.http" haproxy_default_http_check: haproxy_default_monitor_uri: +haproxy_default_unique_id_format: # Userlist haproxy_userlist: diff --git a/defaults/main.yml b/defaults/main.yml index aca52a8..4825409 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -82,6 +82,7 @@ haproxy_default_errorfiles: - "403 {{ haproxy_errors_directory }}/403.http" # haproxy_default_http_check: # haproxy_default_monitor_uri: +# haproxy_default_unique_id_format: # Stats haproxy_stats: true diff --git a/templates/etc/haproxy/haproxy-default.cfg.j2 b/templates/etc/haproxy/haproxy-default.cfg.j2 index d733edc..cb9cfca 100644 --- a/templates/etc/haproxy/haproxy-default.cfg.j2 +++ b/templates/etc/haproxy/haproxy-default.cfg.j2 @@ -42,3 +42,6 @@ defaults {% if haproxy_default_mode is defined and haproxy_default_mode | length > 0 %} mode {{ haproxy_default_mode }} {% endif %} +{% if haproxy_default_unique_id_format is defined and haproxy_default_unique_id_format | length %} + unique-id-format {{ haproxy_default_unique_id_format }} +{% endif %} diff --git a/templates/etc/haproxy/haproxy-frontend.cfg.j2 b/templates/etc/haproxy/haproxy-frontend.cfg.j2 index d3da48d..3c74c78 100644 --- a/templates/etc/haproxy/haproxy-frontend.cfg.j2 +++ b/templates/etc/haproxy/haproxy-frontend.cfg.j2 @@ -121,6 +121,9 @@ frontend {{ name }} {% if value.default_backend is defined %} default_backend {{ value.default_backend }} {% endif %} + {% if value.unique_id_format is defined %} + unique-id-format {{ value.unique_id_format }} + {% endif %} {% endfor %} {% endfor %} diff --git a/templates/etc/haproxy/haproxy-listen.cfg.j2 b/templates/etc/haproxy/haproxy-listen.cfg.j2 index 50f1396..3110556 100644 --- a/templates/etc/haproxy/haproxy-listen.cfg.j2 +++ b/templates/etc/haproxy/haproxy-listen.cfg.j2 @@ -133,6 +133,9 @@ listen {{ name }} log-format {{ log_format }} {% endfor %} {% endif %} + {% if value.unique_id_format is defined %} + unique-id-format {{ value.unique_id_format }} + {% endif %} {% endfor %} {% endfor %}