Merge "Support network_device_mtu of nova managed interfaces"

This commit is contained in:
Jenkins
2014-01-14 16:54:52 +00:00
committed by Gerrit Code Review
2 changed files with 26 additions and 1 deletions

View File

@@ -48,6 +48,9 @@
# (optional) Whether to use Neutron for networking of VMs
# Defaults to true
#
# [*network_device_mtu*]
# (optional) The MTU size for the interfaces managed by nova
# Defaults to undef
#
class nova::compute (
$enabled = false,
@@ -60,7 +63,8 @@ class nova::compute (
$vncproxy_path = '/vnc_auto.html',
$force_config_drive = false,
$virtio_nic = false,
$neutron_enabled = true
$neutron_enabled = true,
$network_device_mtu = undef
) {
include nova::params
@@ -107,6 +111,16 @@ class nova::compute (
nova_config { 'DEFAULT/libvirt_use_virtio_for_bridges': value => true }
}
if $network_device_mtu {
nova_config {
'DEFAULT/network_device_mtu': value => $network_device_mtu;
}
} else {
nova_config {
'DEFAULT/network_device_mtu': ensure => absent;
}
}
package { 'pm-utils':
ensure => present,
}

View File

@@ -26,6 +26,8 @@ describe 'nova::compute' do
'http://127.0.0.1:6080/vnc_auto.html'
) }
it { should contain_nova_config('DEFAULT/network_device_mtu').with('ensure' => 'absent') }
it { should contain_service('nova-compute').with(
'name' => 'nova-compute',
'ensure' => 'stopped',
@@ -78,6 +80,15 @@ describe 'nova::compute' do
it { should contain_nova_config('DEFAULT/force_config_drive').with_value('true') }
end
describe 'with network_device_mtu specified' do
let :params do
{:network_device_mtu => 9999}
end
it { should contain_nova_config('DEFAULT/network_device_mtu').with_value('9999') }
end
describe 'with package version' do
let :params do