From 67be07fd5b1ed0a4257d086a90be9a9fd91d1c0c Mon Sep 17 00:00:00 2001
From: Brian Haley <haleyb.dev@gmail.com>
Date: Fri, 9 Jun 2023 17:35:49 -0400
Subject: [PATCH] Add new DEFAULT option named "my_ipv6"

Add a new config parameter named "my_ipv6".
The default value for my_ipv6 will be the IPv6 address
of the interface used for the default gateway.

This new option is not used for now in any neutron code,
but may be used by operators to configure other options
(like local_ip, ovsdb_connection, etc.).

Requires oslo.utils version 6.2.0.

Change-Id: Icd802879e56aec00793b3683e84b16847d1c798d
---
 neutron/conf/common.py                                   | 4 ++++
 .../notes/new-my-ipv6-config-361b5dc824591fe5.yaml       | 9 +++++++++
 requirements.txt                                         | 2 +-
 3 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 releasenotes/notes/new-my-ipv6-config-361b5dc824591fe5.yaml

diff --git a/neutron/conf/common.py b/neutron/conf/common.py
index cdb5e179f02..68616fe78e1 100644
--- a/neutron/conf/common.py
+++ b/neutron/conf/common.py
@@ -161,6 +161,10 @@ core_opts = [
                help=_('IPv4 address of this host. If no address is provided '
                       'and one cannot be determined, 127.0.0.1 will be '
                       'used.')),
+    cfg.StrOpt('my_ipv6', default=netutils.get_my_ipv6(),
+               help=_('IPv6 address of this host. If no address is provided '
+                      'and one cannot be determined, ::1 will be '
+                      'used.')),
 ]
 
 core_cli_opts = [
diff --git a/releasenotes/notes/new-my-ipv6-config-361b5dc824591fe5.yaml b/releasenotes/notes/new-my-ipv6-config-361b5dc824591fe5.yaml
new file mode 100644
index 00000000000..6d606fd4774
--- /dev/null
+++ b/releasenotes/notes/new-my-ipv6-config-361b5dc824591fe5.yaml
@@ -0,0 +1,9 @@
+---
+other:
+  - |
+    Add a new config option in DEFAULT section named ``my_ipv6``.
+    This new config option will be set by default to the local IPv6 configured
+    to reach the default gateway.
+    This new setting might be useful for operators that need to configure this
+    IP in another part of their config (like OVS/local_ip) without relying on
+    any external templating system.
diff --git a/requirements.txt b/requirements.txt
index fe0bbf0b0f0..7e208c38f39 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -44,7 +44,7 @@ oslo.rootwrap>=5.15.0 # Apache-2.0
 oslo.serialization>=2.25.0 # Apache-2.0
 oslo.service>=2.8.0 # Apache-2.0
 oslo.upgradecheck>=1.3.0 # Apache-2.0
-oslo.utils>=4.8.0 # Apache-2.0
+oslo.utils>=6.2.0 # Apache-2.0
 oslo.versionedobjects>=1.35.1 # Apache-2.0
 osprofiler>=2.3.0 # Apache-2.0
 os-ken>=2.2.0 # Apache-2.0