From d8c70ecadc80886ff3990a216a52cabf79659c6d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bart=C5=82omiej=20Daca?= <bartek.daca@gmail.com>
Date: Thu, 8 Sep 2016 19:15:49 +0200
Subject: [PATCH] Adding manila endpoints to HAProxy

Manila endpoints (internal and external) should be created in
haproxy configuration just like other services.

Change-Id: I5dbc6ca94a118b9655e1c5a87b0a5163153ab5af
Closes-Bug: #1621556
---
 ansible/roles/haproxy/templates/haproxy.cfg.j2 | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/ansible/roles/haproxy/templates/haproxy.cfg.j2 b/ansible/roles/haproxy/templates/haproxy.cfg.j2
index c58680490..b4e640b49 100644
--- a/ansible/roles/haproxy/templates/haproxy.cfg.j2
+++ b/ansible/roles/haproxy/templates/haproxy.cfg.j2
@@ -337,6 +337,22 @@ listen murano_api_external
 {% endif %}
 {% endif %}
 
+{% if enable_manila | bool %}
+listen manila_api
+  bind {{ kolla_internal_vip_address }}:{{ manila_api_port }}
+{% for host in groups['manila-api'] %}
+  server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ manila_api_port }} check inter 2000 rise 2 fall 5
+{% endfor %}
+{% if haproxy_enable_external_vip | bool %}
+
+listen manila_api_external
+  bind {{ kolla_external_vip_address }}:{{ manila_api_port }} {{ tls_bind_info }}
+{% for host in groups['manila-api'] %}
+  server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ manila_api_port }} check inter 2000 rise 2 fall 5
+{% endfor %}
+{% endif %}
+{% endif %}
+
 {% if enable_magnum | bool %}
 listen magnum_api
   bind {{ kolla_internal_vip_address }}:{{ magnum_api_port }}
-- 
GitLab