From adaba13bdb9da1f49dcdb1bb7dcfa7c04c556922 Mon Sep 17 00:00:00 2001 From: Arnaud Morin Date: Tue, 21 Mar 2023 11:23:00 +0100 Subject: [PATCH] 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 Change-Id: Idee31f2c4fed992ed63a51bfbb8d6e2ebb54cf5d --- neutron/conf/common.py | 5 +++++ .../notes/new-my-ip-config-b8efeb05dd50cfd6.yaml | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 releasenotes/notes/new-my-ip-config-b8efeb05dd50cfd6.yaml diff --git a/neutron/conf/common.py b/neutron/conf/common.py index c820b3c5d78..845cb138757 100644 --- a/neutron/conf/common.py +++ b/neutron/conf/common.py @@ -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 = [ diff --git a/releasenotes/notes/new-my-ip-config-b8efeb05dd50cfd6.yaml b/releasenotes/notes/new-my-ip-config-b8efeb05dd50cfd6.yaml new file mode 100644 index 00000000000..ebcedd40189 --- /dev/null +++ b/releasenotes/notes/new-my-ip-config-b8efeb05dd50cfd6.yaml @@ -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.