Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
$base_version = regsubst($version,'^(.*)-\d$','\1')
$real_package_source = "http://www.rabbitmq.com/releases/rabbitmq-server/v${base_version}/rabbitmq-server-${version}.noarch.rpm"
}
'OpenBSD': {
'OpenBSD', 'FreeBSD': {
# We just use the default OpenBSD package from a mirror
$real_package_source = undef
}
Expand Down
11 changes: 11 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@
$rabbitmq_home = '/var/rabbitmq'
$plugin_dir = '/usr/local/lib/rabbitmq/plugins'
}
'FreeBSD': {
$package_ensure = 'installed'
$package_name = 'rabbitmq'
$service_name = 'rabbitmq'
$package_provider = 'pkgng'
$version = '3.4.2'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, keep in mind that while $version is used internally as things work now, it's ignored when using the system package provider, so it doesn't really matter in this case.

$rabbitmq_user = 'rabbitmq'
$rabbitmq_group = 'rabbitmq'
$rabbitmq_home = '/var/db/rabbitmq'
$plugin_dir = '/usr/local/lib/rabbitmq/plugins'
}
'RedHat': {
$package_ensure = 'installed'
$package_name = 'rabbitmq-server'
Expand Down
11 changes: 11 additions & 0 deletions spec/classes/rabbitmq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1384,6 +1384,17 @@
end
end

context "on FreeBSD" do
with_freebsd_facts
it 'installs the rabbitmq package' do
should contain_package('rabbitmq-server').with(
'ensure' => 'installed',
'name' => 'rabbitmq',
'provider' => 'freebsd'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is why your test is failing, it's expecting pkgng.
Though I think provider isn't actually needed. Not sure if #493 will get merged, but would have to adjust slightly to get FreeBSD support working if / when that gets merged.

)
end
end

describe 'repo management on Debian' do
with_debian_facts

Expand Down
13 changes: 13 additions & 0 deletions spec/spec_helper_local.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@ def with_openbsd_facts
end
end

def with_freebsd_facts
# operatingsystemmajrelease is too broad
# operatingsystemrelease may contain X.X-current
# or other prefixes
let :facts do
super().merge({
:kernelversion => '12',
:osfamily => 'FreeBSD',
:staging_http_get => '',
})
end
end

def with_redhat_facts
let :facts do
super().merge({
Expand Down