Use ensure_packages to install utilities
* Remove nested declaration of nova::utilities::install Change-Id: I232f8aae8889e448710157966de61510d7420c63
This commit is contained in:
@@ -1,14 +1,6 @@
|
|||||||
# unzip swig screen parted curl euca2ools - extra packages
|
# unzip swig screen parted curl euca2ools - extra packages
|
||||||
class nova::utilities {
|
class nova::utilities {
|
||||||
define nova::utilities::install(){
|
|
||||||
if !defined(Package[$title]){
|
|
||||||
package { $title:
|
|
||||||
ensure => present
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if $::osfamily == 'Debian' {
|
if $::osfamily == 'Debian' {
|
||||||
$pkgs = ['unzip', 'screen', 'parted', 'curl', 'euca2ools']
|
ensure_packages(['unzip', 'screen', 'parted', 'curl', 'euca2ools'])
|
||||||
nova::utilities::install{$pkgs:}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
18
spec/classes/nova_utilities_spec.rb
Normal file
18
spec/classes/nova_utilities_spec.rb
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe 'nova::utilities' do
|
||||||
|
|
||||||
|
describe 'on debian platforms' do
|
||||||
|
let :facts do
|
||||||
|
{ :osfamily => 'Debian' }
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'installes utilities' do
|
||||||
|
should contain_package('unzip').with_ensure('present')
|
||||||
|
should contain_package('screen').with_ensure('present')
|
||||||
|
should contain_package('parted').with_ensure('present')
|
||||||
|
should contain_package('curl').with_ensure('present')
|
||||||
|
should contain_package('euca2ools').with_ensure('present')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user