Skip to content

Commit

Permalink
Add network_device_mtu to neutron.conf
Browse files Browse the repository at this point in the history
Already a parameter for L3_agent, but that isn't
exactly the right configuration, due to the fact
that this parameter is specifically a L2 feature.

Added in neutron.conf to set the default MTU for all
created networks. Discussion available here:

http://lists.openstack.org/pipermail/openstack-dev/2013-October/017033.html
https://bugs.launchpad.net/openstack-manuals/+bug/1242534

Added test to validate parameter
Fixed mis-spelled parameter in test
Added deprecation warninigs to agents/l3.pp

Closes-Bug: #1329643
Change-Id: Id8544799855c500f0c871681695db502ab4dc87c
  • Loading branch information
rstarmer committed Jul 11, 2014
1 parent 069d086 commit 2da560c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions manifests/agents/l3.pp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
# [*network_device_mtu*]
# (optional) The MTU size for the interfaces managed by the L3 agent
# Defaults to undef
# Should be deprecated in the next major release in favor of a global parameter
#
# [*router_delete_namespaces*]
# (optional) namespaces can be deleted cleanly on the host running the L3 agent
Expand Down Expand Up @@ -117,10 +118,12 @@
}

if $network_device_mtu {
warning('The neutron::l3_agent::newtork_device_mtu parameter is deprecated, use neutron::newtork_device_mtu instead.')
neutron_l3_agent_config {
'DEFAULT/network_device_mtu': value => $network_device_mtu;
}
} else {
warning('The neutron::l3_agent::newtork_device_mtu parameter is deprecated, use neutron::newtork_device_mtu instead.')
neutron_l3_agent_config {
'DEFAULT/network_device_mtu': ensure => absent;
}
Expand Down
16 changes: 16 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
# This enables redundant DHCP agents for configured networks.
# Defaults to 1
#
# [*network_device_mtu*]
# (optional) The MTU size for the interfaces managed by neutron
# Defaults to undef
#
# [*allow_bulk*]
# (optional) Enable bulk crud operations
# Defaults to true
Expand Down Expand Up @@ -188,6 +192,7 @@
$mac_generation_retries = 16,
$dhcp_lease_duration = 86400,
$dhcp_agents_per_network = 1,
$network_device_mtu = undef,
$allow_bulk = true,
$allow_pagination = false,
$allow_sorting = false,
Expand Down Expand Up @@ -317,6 +322,17 @@
}
}

if $network_device_mtu {
neutron_config {
'DEFAULT/network_device_mtu': value => $network_device_mtu;
}
} else {
neutron_config {
'DEFAULT/network_device_mtu': ensure => absent;
}
}


if $service_plugins {
if is_array($service_plugins) {
neutron_config { 'DEFAULT/service_plugins': value => join($service_plugins, ',') }
Expand Down
14 changes: 14 additions & 0 deletions spec/classes/neutron_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
should contain_neutron_config('DEFAULT/mac_generation_retries').with_value(16)
should contain_neutron_config('DEFAULT/dhcp_lease_duration').with_value(86400)
should contain_neutron_config('DEFAULT/dhcp_agents_per_network').with_value(1)
should contain_neutron_config('DEFAULT/network_device_mtu').with_ensure('absent')
should contain_neutron_config('DEFAULT/allow_bulk').with_value(true)
should contain_neutron_config('DEFAULT/allow_pagination').with_value(false)
should contain_neutron_config('DEFAULT/allow_sorting').with_value(false)
Expand Down Expand Up @@ -323,6 +324,19 @@
end

end

shared_examples_for 'with network_device_mtu defined' do
before do
params.merge!(
:network_device_mtu => 9000
)
end

it do
should contina_neutron_config('DEFAULT/network_device_mtu').with_value(params[:newtork_device_mtu])
end
end

context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
Expand Down

0 comments on commit 2da560c

Please sign in to comment.