Add variable to disable stick-table

In some use cases you may want to define your own stick-table and
rules, this can be done using the backend_arguments variables.
As you can have only one stick-table per backend or frontend
the default stick-table needs to be disabled.

I am also not convinved the default stick-table is used for anything,
it just logs requests and never uses the logs, i think it could be
removed.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/797819

Change-Id: I54307c00673ababb277257f2bb0e456e3e011ac4
This commit is contained in:
James Gibson 2021-06-23 14:06:08 +01:00
parent f058cf8d61
commit 3139772435
2 changed files with 7 additions and 0 deletions

View File

@ -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.

View File

@ -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