Make package 'bridge-utils' install optional

When using puppet-nova with another big Puppet modules
this package may be defined before.

The solution is to make an installation optional.

Change-Id: I744fe89e8d9dae79a5b822ac1a1ad4cee780bfc4
Closes-Bug: #1445437
This commit is contained in:
Sergey Vasilenko
2015-04-17 13:55:24 +03:00
parent 68c0cfe935
commit 6f5e9443a2
2 changed files with 22 additions and 1 deletions

View File

@@ -60,6 +60,11 @@
# (optional) Whether to use Neutron for networking of VMs
# Defaults to true
#
# [*install_bridge_utils*]
# (optional) Whether to install the bridge-utils package or not.
# Applicable only for cases when Neutron was disabled
# Defaults to true
#
# [*network_device_mtu*]
# (optional) The MTU size for the interfaces managed by nova
# Defaults to undef
@@ -120,6 +125,7 @@ class nova::compute (
$force_config_drive = false,
$virtio_nic = false,
$neutron_enabled = true,
$install_bridge_utils = true,
$network_device_mtu = undef,
$instance_usage_audit = false,
$instance_usage_audit_period = 'month',
@@ -151,7 +157,7 @@ class nova::compute (
'DEFAULT/vnc_keymap': value => $vnc_keymap;
}
if $neutron_enabled != true {
if $neutron_enabled != true and $install_bridge_utils {
# Install bridge-utils if we use nova-network
package { 'bridge-utils':
ensure => present,

View File

@@ -121,6 +121,21 @@ describe 'nova::compute' do
:before => 'Nova::Generic_service[compute]'
)
end
end
context 'with install_bridge_utils set to false' do
let :params do
{ :install_bridge_utils => false }
end
it 'does not install bridge-utils package for nova-network' do
is_expected.to_not contain_package('bridge-utils').with(
:ensure => 'present',
:before => 'Nova::Generic_service[compute]'
)
end
end
context 'with vnc_enabled set to false' do