aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDipa Thakkar <dthakkar@cisco.com>2016-06-24 15:18:15 -0400
committerDipa Thakkar <dthakkar@cisco.com>2016-06-27 11:36:10 -0400
commite26751b95505ce43aaef6c264ab03b755ab79d77 (patch)
treee7c42fc8b4219b251b3c4682846716cf0c2cf4d4
parentb6e51e9531caaa6bda58de5c91e288763c588de2 (diff)
downloadkolla-e26751b95505ce43aaef6c264ab03b755ab79d77.tar.gz
kolla-e26751b95505ce43aaef6c264ab03b755ab79d77.zip
Remove MariaDB warning from HAproxy
The forwardfor option cannot be used in certain modes such as TCP. To resolve that create a special default section for MariaDB Change-Id: I743bbbfb732b04f115d1a878a0dfc22e29d2623d Closes-Bug: #1549746
-rw-r--r--ansible/roles/haproxy/templates/haproxy.cfg.j243
1 files changed, 30 insertions, 13 deletions
diff --git a/ansible/roles/haproxy/templates/haproxy.cfg.j2 b/ansible/roles/haproxy/templates/haproxy.cfg.j2
index 3bd8cc8fd..79915d778 100644
--- a/ansible/roles/haproxy/templates/haproxy.cfg.j2
+++ b/ansible/roles/haproxy/templates/haproxy.cfg.j2
@@ -36,19 +36,6 @@ listen stats
stats realm Haproxy\ Stats
stats auth {{ haproxy_user }}:{{ haproxy_password }}
-{% if enable_mariadb | bool %}
-listen mariadb
- mode tcp
- option tcplog
- option tcpka
- option mysql-check user haproxy
- bind {{ kolla_internal_vip_address }}:{{ mariadb_port }}
-{% for host in groups['mariadb'] %}
- server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ mariadb_port }} check inter 2000 rise 2 fall 5 {% if not loop.first %}backup{% endif %}
-
-{% endfor %}
-{% endif %}
-
{% if enable_rabbitmq | bool %}
listen rabbitmq_management
bind {{ kolla_internal_vip_address }}:{{ rabbitmq_management_port }}
@@ -393,3 +380,33 @@ listen elasticsearch
server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ elasticsearch_port }} check inter 2000 rise 2 fall 5
{% endfor %}
{% endif %}
+
+# (NOTE): This defaults section deletes forwardfor as recomended by:
+# https://marc.info/?l=haproxy&m=141684110710132&w=1
+
+defaults
+ log global
+ mode http
+ option redispatch
+ option httplog
+ retries 3
+ timeout http-request 10s
+ timeout queue 1m
+ timeout connect 10s
+ timeout client 1m
+ timeout server 1m
+ timeout check 10s
+
+{% if enable_mariadb | bool %}
+listen mariadb
+ mode tcp
+ option tcplog
+ option tcpka
+ option mysql-check user haproxy
+ bind {{ kolla_internal_vip_address }}:{{ mariadb_port }}
+{% for host in groups['mariadb'] %}
+ server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ mariadb_port }} check inter 2000 rise 2 fall 5 {% if not loop.first %}backup{% endif %}
+
+{% endfor %}
+{% endif %}
+