Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for FreeBSD #282

Merged
merged 2 commits into from
Nov 3, 2020
Merged

Conversation

martijndegouw
Copy link
Contributor

Add support for FreeBSD. Tested on FreeBSD 12.1

@bastelfreak bastelfreak added enhancement New feature or request needs-work not ready to merge just yet tests-fail labels Mar 25, 2020
@bastelfreak
Copy link
Member

@martijndegouw thanks for the PR! Can you u take a look at the failing spec tests and also add FreeBSD to the metadata.json?

@vox-pupuli-tasks
Copy link

Dear @martijndegouw, thanks for the PR!

This is Vox Pupuli Tasks, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase?

You can find my sourcecode at voxpupuli/vox-pupuli-tasks

@bastelfreak
Copy link
Member

@martijndegouw thanks for the updates. can you take a look at the failing tests?

@@ -230,50 +230,54 @@
end

context 'when forwarder not already installed' do
Copy link
Member

Choose a reason for hiding this comment

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

instead of the additional level in indentation, you can do the following:

Suggested change
context 'when forwarder not already installed' do
context 'when forwarder not already installed', unless: facts[:kernel] == 'FreeBSD' do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can change that, if that's the preferred way. I just copied it over from the tests above.

Copy link
Contributor Author

@martijndegouw martijndegouw Nov 3, 2020

Choose a reason for hiding this comment

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

I guess it would be nice to have a test for service_provider == freebsd as well. I'll give that a try.

@@ -261,6 +282,7 @@
'Debian': { $package_provider = 'dpkg' }
'Solaris': { $package_provider = 'sun' }
'Suse': { $package_provider = 'rpm' }
'FreeBSD': { $package_provider = 'pkgng' }
Copy link
Member

Choose a reason for hiding this comment

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

Is setting this required? in 99% of the cases undef is fine and puppet will figure it out automatically.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just added it for completeness, but it looks like there is code depending on it in

if $splunk::forwarder::package_provider and !($splunk::forwarder::package_provider in ['apt','chocolatey','yum']) {

To be honest, I did not test it without setting is specifically.

@@ -231,7 +231,7 @@

context 'when forwarder not already installed' do
let(:facts) do
facts.merge(splunkforwarder_version: nil, service_provider: 'systemd')
facts.merge(splunkforwarder_version: '7.3.3', service_provider: facts[:kernel] == 'FreeBSD' ? 'freebsd' : 'systemd')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

wh00ps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants