Add new DEFAULT option named "my_ip"

Add a new parameter in config named "my_ip".
The default value for my_ip will be the IPv4 of the interface used for
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.).

Signed-off-by: Arnaud Morin <arnaud.morin@gmail.com>
Change-Id: Idee31f2c4fed992ed63a51bfbb8d6e2ebb54cf5d
This commit is contained in:
Arnaud Morin 2023-03-21 11:23:00 +01:00 committed by Arnaud Morin
parent 7ebd753bbf
commit adaba13bdb
2 changed files with 14 additions and 0 deletions

View File

@ -17,6 +17,7 @@ from neutron_lib import constants
from neutron_lib.utils import net
from oslo_config import cfg
from oslo_service import wsgi
from oslo_utils import netutils
from neutron._i18n import _
@ -151,6 +152,10 @@ core_opts = [
'2. DHCP scheduler API extension '
'3. Network scheduling mechanism '
'4. DHCP RPC/notification')),
cfg.StrOpt('my_ip', default=netutils.get_my_ipv4(),
help=_('IPv4 address of this host. If no address is provided '
'and one cannot be determined, 127.0.0.1 will be '
'used.')),
]
core_cli_opts = [

View File

@ -0,0 +1,9 @@
---
other:
- |
Add a new config option in DEFAULT section named ``my_ip``.
This new config option will be set by default to the local IPv4 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.