Skip to content
Merged
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
8 changes: 8 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@
$rabbitmq_group = '_rabbitmq'
$rabbitmq_home = '/var/rabbitmq'
}
'FreeBSD': {
$package_ensure = 'installed'
$package_name = 'rabbitmq'
$service_name = 'rabbitmq'
$rabbitmq_user = 'rabbitmq'
$rabbitmq_group = 'rabbitmq'
$rabbitmq_home = '/var/db/rabbitmq'
}
'RedHat': {
$package_ensure = 'installed'
$package_name = 'rabbitmq-server'
Expand Down
6 changes: 6 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
"12.04",
"14.04"
]
},
{
"operatingsystem": "FreeBSD"
Copy link
Member

Choose a reason for hiding this comment

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

freebsd isnt rolling release (well, kind of), so we shul list the versions we support. same for openbsd

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I wasn't sure which versions this would work with, and was mostly relying on examples from other modules. Because of the ports system, my guess is that the range of present and future supported versions might be pretty broad, though I don't know how far back we'd want to support.

I do use FreeBSD and OpenBSD (FBSD since the 4.x days), but not with Puppet, so I didn't really know what values are reasonable here. Suggestions or PR to my PR are welcome 😉

},
{
"operatingsystem": "OpenBSD"
}
],
"requirements": [
Expand Down
10 changes: 10 additions & 0 deletions spec/classes/rabbitmq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1382,6 +1382,16 @@
end
end

context "on FreeBSD" do
with_freebsd_facts
it 'installs the rabbitmq package' do
is_expected.to contain_package('rabbitmq-server').with(
'ensure' => 'installed',
'name' => 'rabbitmq',
)
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 @@ -33,6 +33,19 @@ def with_openbsd_facts
end
end

def with_freebsd_facts
# operatingsystemmajrelease is too broad
Copy link
Member

Choose a reason for hiding this comment

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

do we mock stuff here that is totally different in the real world, depending on the freebsd trouble? does it bring us into trouble?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not quite sure I follow?

Copy link
Member

Choose a reason for hiding this comment

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

are the facts we simulate here used? If so, we should probably simulate them correctly, for all supported freebsd versions (or rely on rspec-puppet-facts)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ps - reformatted this one. I think they are (like the other OSes in this file) valid, but not the only possible value.
For example, we support CentOS 6, but only supply facts for 7.

# 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(operatingsystemmajrelease: '7',
Expand Down