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 splunkforwarder_version fact #206

Merged
merged 3 commits into from
Nov 6, 2018
Merged

Conversation

treydock
Copy link
Contributor

Adds splunkfowarder_version fact that works for both Linux and Windows.

@treydock
Copy link
Contributor Author

Should change to spec_helper be made to module_sync repo?

@treydock treydock force-pushed the facts branch 2 times, most recently from 4532f8c to 96f7ec4 Compare October 29, 2018 15:48
@treydock
Copy link
Contributor Author

Can't get this to work on Windows and my Windows knowledge is very limited. I've added this debug at top of fact:

Facter.debug("EXISTS: #{File.exist?('C:/')}")
Facter.debug("EXISTS: #{File.exist?('C:/Program Files')}")
Facter.debug("EXISTS: #{File.exist?('C:/Program Files/SplunkUniveralForwarder')}")
Facter.debug("EXISTS: #{File.exist?('C:/Program Files/SplunkUniveralForwarder/bin')}")
Facter.debug("EXISTS: #{File.exist?('C:/Program Files/SplunkUniveralForwarder/bin/splunk.exe')}")

The result is this:

2018-10-29 12:04:19.884098 DEBUG puppetlabs.facter - EXISTS: true
2018-10-29 12:04:19.884098 DEBUG puppetlabs.facter - EXISTS: true
2018-10-29 12:04:19.884098 DEBUG puppetlabs.facter - EXISTS: false
2018-10-29 12:04:19.884098 DEBUG puppetlabs.facter - EXISTS: false
2018-10-29 12:04:19.884098 DEBUG puppetlabs.facter - EXISTS: false

For some reason I can't see C:\Program Files\SplunkUniversalForwarder but when I run those commands via irb the result is true.

@treydock
Copy link
Contributor Author

Arg. Fixed, I was spelling Universal wrong.

@treydock
Copy link
Contributor Author

[root@puppet0 ~]# facter -p splunkforwarder_version
6.5.2
C:\Windows\system32>facter -p splunkforwarder_version
7.0.2

@alexjfisher
Copy link
Member

Should change to spec_helper be made to module_sync repo?

modulesync_config already supports this. You need the following in .sync.yml.

spec/spec_helper.rb:
  mock_with: :rspec

eg
https://github.com/voxpupuli/puppet-mongodb/blob/2aef85553d4a7e8b67386ba81a650a9c8dec288c/.sync.yml#L9-L10

spec/spec_helper.rb Show resolved Hide resolved
@treydock
Copy link
Contributor Author

Moved the spec_helper change to separate commit and added the necessary update to .sync.yml

@bastelfreak
Copy link
Member

@alexjfisher can you recheck? I'm fine with it.

@alexjfisher alexjfisher merged commit aa42444 into voxpupuli:master Nov 6, 2018
@alexjfisher
Copy link
Member

@treydock Thanks!

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