diff --git a/releasenotes/notes/stick-table-9ef4bd94a4a000b3.yaml b/releasenotes/notes/stick-table-9ef4bd94a4a000b3.yaml new file mode 100644 index 0000000..7dcc05b --- /dev/null +++ b/releasenotes/notes/stick-table-9ef4bd94a4a000b3.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Added new variable haproxy_stick_table_enabled to haproxy_service_configs, + that allows you to conditionally enable or disable the default stick-table. diff --git a/templates/service.j2 b/templates/service.j2 index 122b750..40ee45b 100644 --- a/templates/service.j2 +++ b/templates/service.j2 @@ -98,8 +98,10 @@ backend {{ item.service.haproxy_service_name }}-back {% if item.service.haproxy_timeout_server is defined %} timeout server {{ item.service.haproxy_timeout_server }} {% endif %} +{% if (item.service.haproxy_stick_table_enabled | default(true) | bool) %} stick store-request src stick-table type ip size 256k expire 30m +{% endif %} {% if request_option == "http" %} option forwardfor option httplog