Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
Added explicit error when using indexer_discovery without setting cm
Browse files Browse the repository at this point in the history
  • Loading branch information
jorritfolmer committed Sep 10, 2017
1 parent 9c3bef4 commit b5d9f53
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 3.4.3

- Added explicit error when using indexer_discovery without setting cm

### 3.4.2

- Fixed service status confusion (Issue #16)
Expand Down
5 changes: 4 additions & 1 deletion manifests/outputs.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# vim: ts=2 sw=2 et
class splunk::outputs (
$type = $splunk::type,
$tcpout = $splunk::tcpout,
$clustering = $splunk::clustering,
$splunk_os_user = $splunk::real_splunk_os_user,
Expand All @@ -13,8 +14,10 @@
$sslrootcapath = $splunk::sslrootcapath,
$sslcertpath = $splunk::sslcertpath
){
if $clustering[cm] == undef {
if $clustering[cm] == undef and $type == undef {
$cm = "${::fqdn}:8089"
} elsif $clustering[cm] == undef and $type == 'uf' and $tcpout == 'indexer_discovery' {
fail "please set cluster master when using indexer_discovery"
} else {
$cm = $clustering[cm]
}
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jorritfolmer-splunk",
"version": "3.4.2",
"version": "3.4.3",
"author": "Jorrit Folmer",
"summary": "Deploy Splunk indexers, search heads and universal forwarders into any imaginable topology, distributed or (multisite) clustered.",
"license": "MIT",
Expand Down
11 changes: 11 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,17 @@
it { should_not contain_file('/opt/splunkforwarder/etc/apps/puppet_indexer_cluster_pass4symmkey_base/local/server.conf') }
end

context 'with universalforwarder, tcpout == indexer_discovery but without cm' do
let(:params) {
{
:type => 'uf',
:tcpout => 'indexer_discovery',
:admin => { 'hash' => 'zzzz', 'fn' => 'yyyy', 'email' => 'wwww', },
}
}
it { should compile.and_raise_error(/please set cluster master when using indexer_discovery/) }
end

context 'with searchpeers as array' do
let(:params) {
{
Expand Down

0 comments on commit b5d9f53

Please sign in to comment.