From 1077a9a4e70eb8c1e11aea8c7cf223a301ca449b Mon Sep 17 00:00:00 2001
From: Ching Kuo <igene@igene.tw>
Date: Sun, 26 Dec 2021 16:57:28 +0800
Subject: [PATCH] Add ovn_sb_connection to octavia.conf

This commit added ovn_sb_connection to octavia.conf otherwise it will
try to connect to ovn-sb-db using the default address which is
127.0.0.1 while the ovn-sb-db listen on the IP address of the
api_interface.

Closes-Bug: #1950111

Change-Id: I9cb9a0365d00ffd70562b4b3e83493ec09bd52c2
---
 ansible/roles/octavia/templates/octavia.conf.j2      | 1 +
 releasenotes/notes/bug-1950111-8e477fb6a5b58822.yaml | 6 ++++++
 2 files changed, 7 insertions(+)
 create mode 100644 releasenotes/notes/bug-1950111-8e477fb6a5b58822.yaml

diff --git a/ansible/roles/octavia/templates/octavia.conf.j2 b/ansible/roles/octavia/templates/octavia.conf.j2
index 6190a97f7e..1ed0e27e88 100644
--- a/ansible/roles/octavia/templates/octavia.conf.j2
+++ b/ansible/roles/octavia/templates/octavia.conf.j2
@@ -29,6 +29,7 @@ enabled_provider_agents = {{ octavia_provider_agents }}
 {% if neutron_plugin_agent == 'ovn' %}
 [ovn]
 ovn_nb_connection = {{ ovn_nb_connection }}
+ovn_sb_connection = {{ ovn_sb_connection }}
 {% endif %}
 
 [haproxy_amphora]
diff --git a/releasenotes/notes/bug-1950111-8e477fb6a5b58822.yaml b/releasenotes/notes/bug-1950111-8e477fb6a5b58822.yaml
new file mode 100644
index 0000000000..f050688c1a
--- /dev/null
+++ b/releasenotes/notes/bug-1950111-8e477fb6a5b58822.yaml
@@ -0,0 +1,6 @@
+---
+fixes:
+  - |
+    Fixes Octavia's "Connection refused" errors by adding ``ovn_sb_connection``
+    to ``octavia.conf``.
+    `LP#195011 <https://launchpad.net/bugs/195011>`__