Add support for [ovn] dns_records_ovn_owned

Depends-on: https://review.opendev.org/942373
Change-Id: I3759fb532c7434de124bbc14b030f3a0e384eed4
This commit is contained in:
Takashi Kajinami
2025-03-05 23:58:51 +09:00
parent 358ae493a4
commit bc53a98a51
3 changed files with 18 additions and 2 deletions

View File

@@ -90,11 +90,16 @@
# Defaults to $facts['os_service_default']
#
# [*dns_servers*]
# (optional) List of dns servers which will be as forwarders
# if a subnet's dns_nameservers is empty.
# (optional) List of dns servers which will be as forwarders if a subnet's
# dns_nameservers is empty.
# Type: List
# Defaults to $facts['os_service_default']
#
# [*dns_records_ovn_owned*]
# (optional) Whether to consider DNS records local to OVN or not.
# Type: boolean
# Defaults to $facts['os_service_default']
#
# [*vhostuser_socket_dir*]
# (optional) The vhost-user socket directory for OVS
# Type: String
@@ -207,6 +212,7 @@ class neutron::plugins::ml2::ovn(
$dvr_enabled = $facts['os_service_default'],
$disable_ovn_dhcp_for_baremetal_ports = $facts['os_service_default'],
$dns_servers = $facts['os_service_default'],
$dns_records_ovn_owned = $facts['os_service_default'],
$vhostuser_socket_dir = $facts['os_service_default'],
$dhcp_default_lease_time = $facts['os_service_default'],
$ovn_dhcp4_global_options = $facts['os_service_default'],
@@ -265,6 +271,7 @@ class neutron::plugins::ml2::ovn(
'ovn/enable_distributed_floating_ip' : value => $dvr_enabled;
'ovn/disable_ovn_dhcp_for_baremetal_ports': value => $disable_ovn_dhcp_for_baremetal_ports;
'ovn/dns_servers' : value => join(any2array($dns_servers), ',');
'ovn/dns_records_ovn_owned' : value => $dns_records_ovn_owned;
'ovn/vhost_sock_dir' : value => $vhostuser_socket_dir;
'ovn/dhcp_default_lease_time' : value => $dhcp_default_lease_time;
'ovn/ovn_dhcp4_global_options' : value => $ovn_dhcp4_global_options_real;

View File

@@ -0,0 +1,5 @@
---
features:
- |
The new ``neutron::plugins::ml2::ovn::dns_records_ovn_owned`` parameter
has been added.

View File

@@ -28,6 +28,7 @@ describe 'neutron::plugins::ml2::ovn' do
:dvr_enabled => '<SERVICE DEFAULT>',
:disable_ovn_dhcp_for_baremetal_ports => '<SERVICE DEFAULT>',
:dns_servers => '<SERVICE DEFAULT>',
:dns_records_ovn_owned => '<SERVICE DEFAULT>',
:vhostuser_socket_dir => '<SERVICE DEFAULT>',
:dhcp_default_lease_time => '<SERVICE DEFAULT>',
:ovn_dhcp4_global_options => '<SERVICE DEFAULT>',
@@ -77,6 +78,7 @@ describe 'neutron::plugins::ml2::ovn' do
should contain_neutron_plugin_ml2('ovn/enable_distributed_floating_ip').with_value(p[:dvr_enabled])
should contain_neutron_plugin_ml2('ovn/disable_ovn_dhcp_for_baremetal_ports').with_value(p[:disable_ovn_dhcp_for_baremetal_ports])
should contain_neutron_plugin_ml2('ovn/dns_servers').with_value(p[:dns_servers])
should contain_neutron_plugin_ml2('ovn/dns_records_ovn_owned').with_value(p[:dns_records_ovn_owned])
should contain_neutron_plugin_ml2('ovn/vhost_sock_dir').with_value(p[:vhostuser_socket_dir])
should contain_neutron_plugin_ml2('ovn/dhcp_default_lease_time').with_value(p[:dhcp_default_lease_time])
should contain_neutron_plugin_ml2('ovn/ovn_dhcp4_global_options').with_value(p[:ovn_dhcp4_global_options])
@@ -117,6 +119,7 @@ describe 'neutron::plugins::ml2::ovn' do
:dvr_enabled => false,
:disable_ovn_dhcp_for_baremetal_ports => false,
:dns_servers => '8.8.8.8,10.10.10.10',
:dns_records_ovn_owned => false,
:vhostuser_socket_dir => '/var/run/openvswitch',
:dhcp_default_lease_time => 43200,
:ovn_dhcp4_global_options => 'ntp_server:1.2.3.4',
@@ -152,6 +155,7 @@ describe 'neutron::plugins::ml2::ovn' do
should contain_neutron_plugin_ml2('ovn/enable_distributed_floating_ip').with_value(p[:dvr_enabled])
should contain_neutron_plugin_ml2('ovn/disable_ovn_dhcp_for_baremetal_ports').with_value(p[:disable_ovn_dhcp_for_baremetal_ports])
should contain_neutron_plugin_ml2('ovn/dns_servers').with_value(p[:dns_servers])
should contain_neutron_plugin_ml2('ovn/dns_records_ovn_owned').with_value(p[:dns_records_ovn_owned])
should contain_neutron_plugin_ml2('ovn/vhost_sock_dir').with_value(p[:vhostuser_socket_dir])
should contain_neutron_plugin_ml2('ovn/dhcp_default_lease_time').with_value(p[:dhcp_default_lease_time])
should contain_neutron_plugin_ml2('ovn/ovn_dhcp4_global_options').with_value(p[:ovn_dhcp4_global_options])