-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
BREAKING: Ability to download from download.splunk.com #150
BREAKING: Ability to download from download.splunk.com #150
Conversation
.sync.yml
Outdated
@@ -1,6 +1,8 @@ | |||
--- | |||
.travis.yml: | |||
secure: "RrAmWtM6eTjZZzD954AIgR179Pqp14lzHhd/C9cpKbTPynLncuim08CEvjmq+7pgAy9XDg1d02x3udfZt4btR1sBdyNRpNN3yUhWptmGU61HRJdiZq+nSLQkIYsqXanhk+O3NndFojO58WRD01dkWEc6HRHjlivuYNxDXmMkg9k=" | |||
docker_sets: | |||
- set: docker/ubuntu-16.04 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test if our centos/ubuntu14.04/debian8/debian9 (voxpupuli/modulesync_config#388) work as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only enabled this one because of testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding more of the docker sets now since i solved the issue with splunkserver running inside a docker container.
pp = <<-EOS | ||
class { '::splunk::forwarder': } | ||
EOS | ||
# describe 'splunk::forwarder class' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this spec file needed anymore, or did you disable it just for testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disabled just for testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reenabled these since tests are now working inside a docker container.
Before this can be merged i need to figure out why splunk is blowing up on the splunk start command when inside a container. Below is the issue i'm having and the suggested solution. I'm not entirely convinced this is the real solution or even if this works. I will be looking at how others are currently doing their splunk server docker containers. https://answers.splunk.com/answers/323671/splunk-light-running-on-docker-throwing-unusable-f.html |
spec/acceptance/splunk_spec.rb
Outdated
class { '::splunk::params': | ||
version => '7.0.0', | ||
build => 'c8a78efdd40f', | ||
src_root => 'https://download.splunk.com', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be unnecessary, no? (since it's the same as params)?
More generally, I'm not sure about passing stuff into params directly, though I know the module did this before as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can remove this since i did change it to the defaults. Shall i remove this?
Also yes this module uses params in a non-standard way. Partly in fact because both the forwarder and the server try and reuse the params class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw that postgresql module uses postgresql::global
or something along those lines to work around setting things that are common to multiple classes (and then pulls those in / out of params as necessary) - not sure if that's a more standard pattern though... most modules these days seem to be leaning towards having the main class be the interface to everything, and then having toggles there (enable_forwarder = true
in class splunk
). Probably not worth changing in this PR, but might be worth asking about, and possibly changing down the road.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep I agree there are a couple different approaches. That is a beast for another day!
version => '7.0.0', | ||
build => 'c8a78efdd40f', | ||
src_root => 'https://download.splunk.com', | ||
splunkd_port => 8090, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto here, this should be mostly default (except port?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to do this because currently the acceptance test try to install both a splunk forwarder and a splunk enterprise instance on the same node. Each product has a management utility that listens on port 8089 by default. To get around this i just told the forwarder to be on the non-default port.
While this package does allow for uninstalling your splunk forwarder and splunk enterprise instance the uninstallation is technically not quite correct. In order to prevent adding more scope to this already existing bug i did what i did above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But aren't version / build / src_root already set to those by default in params?
But if you're only setting the forwarder to a non-default port, can't splunkd_port
be set in splunk::forwarder
directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose. that is the problem this module makes it confusing with its use of params.pp
I will:
1.) remove the defaults from params.pp
2.) move the splunkd_port to the forwarder class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -103,6 +103,21 @@ | |||
tag => 'splunk_server', | |||
} | |||
|
|||
if $facts['virtual'] == 'docker' { | |||
ini_setting { 'OPTIMISTIC_ABOUT_FILE_LOCKING': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know if this is always needed in any Docker container? Or is it just required for the acceptance tests to work in Travis?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both. I don't know the exact details but if you google splunk docker unusable filesystem This is pretty much the solution everyone provides. Even the chef-splunk repo did this but this was for their acceptance test. I Also could not find exact details on why/how this actually works. If you want to try this out locally under docker remove that line and watch it fail with the above error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I saw the comment before. Just wondering whether it's best to do this in the module or in the acceptance test; I think a case could possibly be made either way, but seems kind of magical, esp. since there's no parameter to control it.
It sounds like if you setup the volumes correctly, it may not be necessary to set this?
https://hub.docker.com/r/alexanderm/docker-splunk/
To work around the unusable filesystem issue you need to mount in a volume from the host for the /opt/splunk/var/lib
For example I started docker like this:
docker run -v /data/splunk-test:/opt/splunk/var/lib -p 8000:8000 -it alexanderm/docker-splunk bash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wyardley I saw that but that isn't "Applicable" i believe in our case. When running docker acceptance tests we are not taking a folder on the host and mapping it to a folder in the docker container. Make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yeah, I thought this change was in the manifest itself, not in the test. I agree that this is a reasonable workaround in the acceptance test itself.
spec/acceptance/splunk_spec.rb
Outdated
@@ -5,6 +5,8 @@ | |||
# Using puppet_apply as a helper | |||
it 'works idempotently with no errors' do | |||
pp = <<-EOS | |||
class { '::splunk::params': | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need to invoke splunk::params
explicitly at all, do you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree :). Let me see if I can remove this without things going haywire
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. I think the splunk::params
invocation is superfluous though?
i'm going to try and add a few other docker sets to this before this gets merged. |
@wyardley I added more docker nodesets as noted below:
|
closes #149 |
- set: docker/debian-7 | ||
- set: docker/debian-8 | ||
- set: docker/ubuntu-14.04 | ||
- set: docker/ubuntu-16.04 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you split the new nodesets at least into an own commit? Or a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing!
… download.splunk.com
…a docker container ( both for travis-ci and users who want to prebuild docker containers with splunk installed ).
… i need to force the forwarder to listen on a different port. This prevents splunk server and splunk forwarder ( which is being run on the same machine ) from fightining over ports.
…is also needed to get the idempotence checks to not fail on travis-ci.
This module used to be able to download splunk installer from splunk directly. Unfortunately, when splunk updates their http url paths this module didnt get updated as well. This updates the structure of where the installers should live along with hooking up docker containers for running in travis. Merging this would be considered a breaking change since the folder structure where people are placing the installers at on their local file system are changing to match how splunk NOW does it.
Summary