Merge "Support network_device_mtu of nova managed interfaces"
This commit is contained in:
@@ -48,6 +48,9 @@
|
|||||||
# (optional) Whether to use Neutron for networking of VMs
|
# (optional) Whether to use Neutron for networking of VMs
|
||||||
# Defaults to true
|
# Defaults to true
|
||||||
#
|
#
|
||||||
|
# [*network_device_mtu*]
|
||||||
|
# (optional) The MTU size for the interfaces managed by nova
|
||||||
|
# Defaults to undef
|
||||||
#
|
#
|
||||||
class nova::compute (
|
class nova::compute (
|
||||||
$enabled = false,
|
$enabled = false,
|
||||||
@@ -60,7 +63,8 @@ class nova::compute (
|
|||||||
$vncproxy_path = '/vnc_auto.html',
|
$vncproxy_path = '/vnc_auto.html',
|
||||||
$force_config_drive = false,
|
$force_config_drive = false,
|
||||||
$virtio_nic = false,
|
$virtio_nic = false,
|
||||||
$neutron_enabled = true
|
$neutron_enabled = true,
|
||||||
|
$network_device_mtu = undef
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include nova::params
|
include nova::params
|
||||||
@@ -107,6 +111,16 @@ class nova::compute (
|
|||||||
nova_config { 'DEFAULT/libvirt_use_virtio_for_bridges': value => true }
|
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':
|
package { 'pm-utils':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
}
|
}
|
||||||
|
@@ -26,6 +26,8 @@ describe 'nova::compute' do
|
|||||||
'http://127.0.0.1:6080/vnc_auto.html'
|
'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(
|
it { should contain_service('nova-compute').with(
|
||||||
'name' => 'nova-compute',
|
'name' => 'nova-compute',
|
||||||
'ensure' => 'stopped',
|
'ensure' => 'stopped',
|
||||||
@@ -78,6 +80,15 @@ describe 'nova::compute' do
|
|||||||
|
|
||||||
it { should contain_nova_config('DEFAULT/force_config_drive').with_value('true') }
|
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
|
end
|
||||||
describe 'with package version' do
|
describe 'with package version' do
|
||||||
let :params do
|
let :params do
|
||||||
|
Reference in New Issue
Block a user