From 07b8b79ad3dbeaa534ed1d8db7e312f9beacdf6d Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Sun, 4 Aug 2013 23:38:29 +0200 Subject: [PATCH] Install bridge-utils only if needed The package bridge-utils is useful only if we have nova-network. If we use Neutron, we don't have to install it. This patch provides a condition "neutron_enabled" to check before the installation of the package. Fix bug #1176087 Change-Id: Iee2ecbf2023ab211d67cb9bfeb3dbc5b4bb3eb89 --- manifests/compute.pp | 12 ++++++++---- spec/classes/nova_compute_spec.rb | 5 +++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/manifests/compute.pp b/manifests/compute.pp index acf151a5a..d15b3b355 100644 --- a/manifests/compute.pp +++ b/manifests/compute.pp @@ -10,7 +10,8 @@ class nova::compute ( $vncproxy_port = '6080', $vncproxy_path = '/vnc_auto.html', $force_config_drive = false, - $virtio_nic = false + $virtio_nic = false, + $neutron_enabled = true ) { include nova::params @@ -30,9 +31,12 @@ class nova::compute ( 'DEFAULT/vncserver_proxyclient_address': value => $vncserver_proxyclient_address; } - package { 'bridge-utils': - ensure => present, - before => Nova::Generic_service['compute'], + if $neutron_enabled != true { + # Install bridge-utils if we use nova-network + package { 'bridge-utils': + ensure => present, + before => Nova::Generic_service['compute'], + } } nova::generic_service { 'compute': diff --git a/spec/classes/nova_compute_spec.rb b/spec/classes/nova_compute_spec.rb index 996a31b76..e937576dc 100644 --- a/spec/classes/nova_compute_spec.rb +++ b/spec/classes/nova_compute_spec.rb @@ -10,7 +10,8 @@ describe 'nova::compute' do let :params do { - :vncproxy_host => '127.0.0.1' + :vncproxy_host => '127.0.0.1', + :neutron_enabled => true } end @@ -36,7 +37,7 @@ describe 'nova::compute' do 'ensure' => 'present', 'notify' => 'Service[nova-compute]' ) } - it { should contain_package('bridge-utils').with( + it { should_not contain_package('bridge-utils').with( :ensure => 'present', :before => 'Nova::Generic_service[compute]' ) }