Skip to content

Commit

Permalink
Install package via title, add SLES 11 to metadata (#684)
Browse files Browse the repository at this point in the history
This fixes an issue with the package resource accepting an array for
title, but not for the name parameter. It adds support in metadata.json
for SLES 11 (only) to test the additional package we expect there.
  • Loading branch information
wyardley committed Mar 7, 2018
1 parent 5b7f61f commit 518663a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 1 addition & 2 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
$package_name = $rabbitmq::package_name
$rabbitmq_group = $rabbitmq::rabbitmq_group

package { 'rabbitmq-server':
package { $package_name:
ensure => $package_ensure,
name => $package_name,
notify => Class['rabbitmq::service'],
}

Expand Down
6 changes: 6 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
"16.04"
]
},
{
"operatingsystem": "SLES",
"operatingsystemrelease": [
"11"
]
},
{
"operatingsystem": "FreeBSD"
},
Expand Down
5 changes: 4 additions & 1 deletion spec/classes/rabbitmq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@
it { is_expected.to contain_class('rabbitmq::config') }
it { is_expected.to contain_class('rabbitmq::service') }

it { is_expected.to contain_package('rabbitmq-server').with_ensure('installed').with_name(packagename) }
it { is_expected.to contain_package(packagename).with_ensure('installed').with_name(packagename) }
if facts[:os]['family'] == 'Suse'
it { is_expected.to contain_package('rabbitmq-server-plugins') }
end

context 'with default params' do
it { is_expected.not_to contain_class('rabbitmq::repo::apt') }
Expand Down

0 comments on commit 518663a

Please sign in to comment.