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

SplunkForwarder has no concept of a server_service. #130

Merged
merged 2 commits into from
Sep 20, 2017
Merged

SplunkForwarder has no concept of a server_service. #130

merged 2 commits into from
Sep 20, 2017

Conversation

TraGicCode
Copy link
Contributor

when setting up a splunk forwarder on a posix based system you get a warning because the the default parameter for the splunk::platform::posix class is set to $splunk::server_service which doesn't exist when you create a forwarder. It doesn't exist because it doesn't make sense for a forwarder. While there should be more cleanup this is a simple non-breaking change to fix the annoying warning. A bigger refactor would be required to get this done correctly.

#119

@wyardley
Copy link
Contributor

I am not familiar with this module or Splunk, and also, can't even test it since the acceptance tests won't work even for the forwarder without a locally hosted package.

That said, would adding:
server_service = undef (or server_service = [])
in the line after
https://github.com/voxpupuli/puppet-splunk/blob/master/manifests/forwarder.pp#L140
work, and be a little simpler / less intrusive?

Maybe ask someone who has more experience with this module to review?

@TraGicCode
Copy link
Contributor Author

I agree with your recommendation. This module needs to be cleaned up but that is a bigger beast alltogether. ATM noone can run puppet-rspec against this because of it blows up saying hey there is a variable in this module that doesnt exist!

@TraGicCode
Copy link
Contributor Author

TraGicCode commented Sep 20, 2017

Done.

@wyardley I'm going to try and add a unit test for this to prevent regression and to prove out the fix. Please wait before merging this.

@TraGicCode
Copy link
Contributor Author

The fix you recommended still has this issue. Going to revert my revert ;)

image

@TraGicCode
Copy link
Contributor Author

TraGicCode commented Sep 20, 2017

My fix does indeed work. It also reveals another variable with the same issue.. I will open another issue for this.

image

This is ready for merge unless you have more refactor suggestions @wyardley

…n error because the default is specified as splunk::server_service which isn't used when creating a splunk forwarder.
@TraGicCode TraGicCode requested review from wyardley and removed request for bastelfreak September 20, 2017 14:34
@@ -146,7 +146,13 @@
# there is non-generic configuration that needs to be declared in addition
# to the agnostic resources declared here.
case $::kernel {
Copy link
Member

Choose a reason for hiding this comment

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

on a long term point of view, we should switch to $facts['kernel']

@bastelfreak bastelfreak merged commit a466146 into voxpupuli:master Sep 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants