From 6f5e9443a29834fd669151fa06425a7080c79eb5 Mon Sep 17 00:00:00 2001 From: Sergey Vasilenko Date: Fri, 17 Apr 2015 13:55:24 +0300 Subject: [PATCH] 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 --- manifests/compute.pp | 8 +++++++- spec/classes/nova_compute_spec.rb | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/manifests/compute.pp b/manifests/compute.pp index 53b0f2d86..be56c4af8 100644 --- a/manifests/compute.pp +++ b/manifests/compute.pp @@ -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, diff --git a/spec/classes/nova_compute_spec.rb b/spec/classes/nova_compute_spec.rb index 59adff736..db637161d 100644 --- a/spec/classes/nova_compute_spec.rb +++ b/spec/classes/nova_compute_spec.rb @@ -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