Allow selecting balance method for mysql, pgsql and horizon types
Change-Id: I546ff87f34b3c4352009237fe5ff91009357cd6e
diff --git a/haproxy/files/haproxy.cfg b/haproxy/files/haproxy.cfg
index 7aae743..5926ace 100644
--- a/haproxy/files/haproxy.cfg
+++ b/haproxy/files/haproxy.cfg
@@ -76,7 +76,7 @@
timeout client 300s
timeout server 300s
{%- elif listen.get('type', None) == 'mysql' %}
- balance leastconn
+ balance {{ listen.get('balance', 'leastconn') }}
mode tcp
option httpchk
option tcplog
@@ -86,7 +86,7 @@
timeout server 300s
option mysql-check user haproxy
{%- elif listen.get('type', None) == 'pgsql' %}
- balance leastconn
+ balance {{ listen.get('balance', 'leastconn') }}
mode tcp
option httpchk
option tcplog
@@ -96,7 +96,7 @@
timeout server 28801s
option pgsql-check user postgres
{%- elif listen.get('type', None) == 'horizon' %}
- balance source
+ balance {{ listen.get('balance', 'source') }}
capture cookie vgnvisitor= len 32
cookie SERVERID insert indirect nocache
mode http