Add 'dnsmasq_enable_addr6_list' option

Add support to control the dhcp agent configuration
option 'dnsmasq_enable_addr6_list'.

Related-Bug: #1861032
Depends-On: https://review.opendev.org/704436
Change-Id: I32ee1e9dac3aa97add161aa17c2e87584b6c17a2
This commit is contained in:
Harald Jensås 2020-02-27 20:32:27 +01:00
parent b646b7cf1a
commit e3a932d025
3 changed files with 34 additions and 12 deletions

View File

@ -50,6 +50,11 @@
# via DNS resolvers on the host running the DHCP agent.
# Defaults to $::os_service_default.
#
# [*dnsmasq_enable_addr6_list*]
# (optional) Enable dhcp-host entry with list of addresses when port has
# multiple IPv6 addresses in the same subnet.
# Defaults to $::os_service_default.
#
# [*enable_isolated_metadata*]
# (optional) enable metadata support on isolated networks.
# Defaults to false.
@ -112,6 +117,7 @@ class neutron::agents::dhcp (
$dnsmasq_config_file = $::os_service_default,
$dnsmasq_dns_servers = $::os_service_default,
$dnsmasq_local_resolv = $::os_service_default,
$dnsmasq_enable_addr6_list = $::os_service_default,
$enable_isolated_metadata = false,
$enable_force_metadata = $::os_service_default,
$enable_metadata_network = false,
@ -156,6 +162,7 @@ class neutron::agents::dhcp (
'DEFAULT/dnsmasq_config_file': value => $dnsmasq_config_file;
'DEFAULT/dnsmasq_dns_servers': value => join(any2array($dnsmasq_dns_servers), ',');
'DEFAULT/dnsmasq_local_resolv': value => $dnsmasq_local_resolv;
'DEFAULT/dnsmasq_enable_addr6_list': value => $dnsmasq_enable_addr6_list;
'DEFAULT/ovs_integration_bridge': value => $ovs_integration_bridge;
'agent/availability_zone': value => $availability_zone;
}

View File

@ -0,0 +1,5 @@
---
features:
- |
Add 'dnsmasq_enable_addr6_list' option support to dhcp agent settings.
(See bug: `#1861032 <https://bugs.launchpad.net/neutron/+bug/1861032>`_)

View File

@ -43,6 +43,7 @@ describe 'neutron::agents::dhcp' do
should contain_neutron_dhcp_agent_config('DEFAULT/dhcp_broadcast_reply').with_value('<SERVICE DEFAULT>');
should contain_neutron_dhcp_agent_config('DEFAULT/ovs_integration_bridge').with_value('<SERVICE DEFAULT>');
should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_local_resolv').with_value('<SERVICE DEFAULT>');
should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_enable_addr6_list').with_value('<SERVICE DEFAULT>');
should contain_neutron_dhcp_agent_config('agent/availability_zone').with_value('<SERVICE DEFAULT>');
should contain_neutron_dhcp_agent_config('OVS/ovsdb_connection').with_value('<SERVICE DEFAULT>');
should contain_neutron_dhcp_agent_config('OVS/ssl_key_file').with_value('<SERVICE DEFAULT>');
@ -177,6 +178,15 @@ describe 'neutron::agents::dhcp' do
should raise_error(Puppet::Error)
end
end
context 'when enabling dhcp-host entry with list of addresses' do
before :each do
params.merge!(:dnsmasq_enable_addr6_list => true)
end
it 'should enabling dhcp-host entry with list of addresses' do
should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_enable_addr6_list').with_value('true');
end
end
end
shared_examples 'neutron dhcp agent with dnsmasq_config_file specified' do