Adding support for overlay_ip_version
Neutron recently added support for configuring the IP version used for overlay network endpoints. Change-Id: I5bc8a4529e7441e7eb53ae74fc448b1fc01815f3
This commit is contained in:
parent
7ad7a07e50
commit
e6a9d2ecce
@ -128,6 +128,11 @@
|
||||
# the maximum MTU for the driver.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*overlay_ip_version*]
|
||||
# (optional) Configures the IP version used for all overlay network endpoints. Valid values
|
||||
# are 4 and 6.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# DEPRECATED PARAMETERS
|
||||
#
|
||||
# [*sriov_agent_required*]
|
||||
@ -152,6 +157,7 @@ class neutron::plugins::ml2 (
|
||||
$path_mtu = 0,
|
||||
$purge_config = false,
|
||||
$max_header_size = $::os_service_default,
|
||||
$overlay_ip_version = $::os_service_default,
|
||||
# DEPRECATED PARAMETERS
|
||||
$sriov_agent_required = undef,
|
||||
) {
|
||||
@ -167,6 +173,10 @@ class neutron::plugins::ml2 (
|
||||
warning('Security groups will not work without properly set firewall_driver')
|
||||
}
|
||||
|
||||
if !is_service_default($overlay_ip_version) and !($overlay_ip_version in [4, 6]) {
|
||||
fail('Invalid IP version for overlay_ip_version')
|
||||
}
|
||||
|
||||
if $::operatingsystem == 'Ubuntu' {
|
||||
file_line { '/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG':
|
||||
path => '/etc/default/neutron-server',
|
||||
@ -227,6 +237,7 @@ class neutron::plugins::ml2 (
|
||||
'ml2/mechanism_drivers': value => join(any2array($mechanism_drivers), ',');
|
||||
'ml2/path_mtu': value => $path_mtu;
|
||||
'ml2/extension_drivers': value => join(any2array($extension_drivers), ',');
|
||||
'ml2/overlay_ip_version': value => $overlay_ip_version;
|
||||
'securitygroup/enable_security_group': value => $enable_security_group;
|
||||
'securitygroup/firewall_driver': value => $firewall_driver;
|
||||
}
|
||||
|
@ -0,0 +1,3 @@
|
||||
---
|
||||
features:
|
||||
- Add `overlay_ip_version` options support to ml2 plugin settings.
|
@ -77,6 +77,7 @@ describe 'neutron::plugins::ml2' do
|
||||
is_expected.to contain_neutron_plugin_ml2('ml2/extension_drivers').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_neutron_plugin_ml2('ml2/path_mtu').with_value(p[:path_mtu])
|
||||
is_expected.to contain_neutron_plugin_ml2('ml2/physical_network_mtus').with_ensure('absent')
|
||||
is_expected.to contain_neutron_plugin_ml2('ml2/overlay_ip_version').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_neutron_plugin_ml2('securitygroup/firewall_driver').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_neutron_plugin_ml2('securitygroup/enable_security_group').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
@ -114,6 +115,33 @@ describe 'neutron::plugins::ml2' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'when specifying IPv4 overlays' do
|
||||
before :each do
|
||||
params.merge!(:overlay_ip_version => 4)
|
||||
end
|
||||
it 'configures as IPv4' do
|
||||
is_expected.to contain_neutron_plugin_ml2('ml2/overlay_ip_version').with_value(4)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when specifying IPv6 overlays' do
|
||||
before :each do
|
||||
params.merge!(:overlay_ip_version => 6)
|
||||
end
|
||||
it 'configures as IPv6' do
|
||||
is_expected.to contain_neutron_plugin_ml2('ml2/overlay_ip_version').with_value(6)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when specifying an invalid overlay IP versions' do
|
||||
before :each do
|
||||
params.merge!(:overlay_ip_version => 10)
|
||||
end
|
||||
it 'fails to accept value' do
|
||||
is_expected.to raise_error(Puppet::Error)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when using extension drivers for ML2 plugin' do
|
||||
before :each do
|
||||
params.merge!(:extension_drivers => ['port_security','qos'])
|
||||
|
Loading…
Reference in New Issue
Block a user