From 438ae3b640f9a61fc409f1f317da8437e065cd3b Mon Sep 17 00:00:00 2001
From: Cong Ha Minh <conghm1@viettel.com.vn>
Date: Tue, 22 May 2018 11:07:22 +0700
Subject: [PATCH] Use lbproxy instead of lbagent in neutron when deploy Octavia

Disable neutron-lbaas-agent and use lbaasv2-proxy  when enable octavia.
Use keystone-auth v3 and internal endpoint for lbaasv2 plugin.

Change-Id: I69e8436f3722cf99644457323b71b94dc9036bb9
Co-Authored-By: Hieu LE <hieulq2@viettel.com.vn>
Closes-Bug: #1756771
Closes-Bug: #1738115
---
 ansible/roles/neutron/defaults/main.yml               | 6 ++++--
 ansible/roles/neutron/templates/neutron_lbaas.conf.j2 | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/ansible/roles/neutron/defaults/main.yml b/ansible/roles/neutron/defaults/main.yml
index c86d752ae..640d79096 100644
--- a/ansible/roles/neutron/defaults/main.yml
+++ b/ansible/roles/neutron/defaults/main.yml
@@ -116,7 +116,7 @@ neutron_services:
     container_name: "neutron_lbaas_agent"
     image: "{{ neutron_lbaas_agent_image_full }}"
     privileged: True
-    enabled: "{{ enable_neutron_lbaas | bool and neutron_plugin_agent not in ['vmware_nsxv', 'vmware_nsxv3', 'vmware_dvs'] }}"
+    enabled: "{{ enable_neutron_lbaas | bool and not enable_octavia | bool and neutron_plugin_agent not in ['vmware_nsxv', 'vmware_dvs'] }}"
     group: "neutron-lbaas-agent"
     host_in_groups: "{{ inventory_hostname in groups['neutron-lbaas-agent'] }}"
     volumes:
@@ -310,7 +310,9 @@ service_plugins:
   - name: "flow_classifier"
     enabled: "{{ enable_neutron_sfc | bool }}"
   - name: "lbaasv2"
-    enabled: "{{ enable_neutron_lbaas | bool }}"
+    enabled: "{{ enable_neutron_lbaas | bool and not enable_octavia | bool }}"
+  - name: "lbaasv2-proxy"
+    enabled: "{{ enable_neutron_lbaas | bool and enable_octavia | bool }}"
   - name: "neutron_dynamic_routing.services.bgp.bgp_plugin.BgpPlugin"
     enabled: "{{ enable_neutron_bgp_dragent | bool }}"
   - name: "qos"
diff --git a/ansible/roles/neutron/templates/neutron_lbaas.conf.j2 b/ansible/roles/neutron/templates/neutron_lbaas.conf.j2
index 7e56c7886..776abcc8c 100644
--- a/ansible/roles/neutron/templates/neutron_lbaas.conf.j2
+++ b/ansible/roles/neutron/templates/neutron_lbaas.conf.j2
@@ -9,7 +9,7 @@ service_provider = LOADBALANCERV2:Haproxy:neutron_lbaas.drivers.haproxy.plugin_d
 {% endif %}
 
 [service_auth]
-auth_url = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_public_port }}/v3
+auth_url = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_admin_port }}/v3
 admin_tenant_name = service
 admin_user = neutron
 admin_password = {{ neutron_keystone_password }}
-- 
GitLab