Skip to content

Commit cb87764

Browse files
committed
Added replication_port parameter for index clustering
1 parent 970778d commit cb87764

File tree

6 files changed

+22
-2
lines changed

6 files changed

+22
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,8 @@ If you have version >= 6.2.0 servers but with stock settings from a previous Spl
586586

587587
### 3.0.0
588588

589-
- Moved useACK paramter to use_ack due to [stricter language check](https://docs.puppet.com/puppet/latest/reference/lang_reserved.html#parameters)
589+
- Added replication_port parameter to configure index cluster replication port.
590+
- Moved useACK paramter to use_ack due to [Puppet stricter language check](https://docs.puppet.com/puppet/latest/reference/lang_reserved.html#parameters)
590591

591592
### 2.1.2
592593

manifests/init.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
$searchpeers = $splunk::params::searchpeers,
2828
$admin = $splunk::params::admin,
2929
$clustering = $splunk::params::clustering,
30+
$replication_port = $splunk::params::replication_port,
3031
$shclustering = $splunk::params::shclustering,
3132
$service = $splunk::params::service,
3233
$use_ack = $splunk::params::use_ack,

manifests/params.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
$searchpeers = 'empty'
2525
$admin = undef
2626
$clustering = { }
27+
$replication_port = 9887
2728
$shclustering = { }
2829
$service = {
2930
enable => true,

manifests/server/clustering.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
$splunk_app_precedence_dir = $splunk::splunk_app_precedence_dir,
77
$splunk_app_replace = $splunk::splunk_app_replace,
88
$clustering = $splunk::clustering,
9+
$replication_port = $splunk::replication_port,
910
){
1011
$splunk_app_name = 'puppet_indexer_cluster'
1112
# if no pass4symmkey defined under clustering, default to general

spec/classes/init_spec.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,22 @@
235235
it { should contain_file('/opt/splunk/etc/apps/puppet_indexer_cluster_pass4symmkey_base/local/server.conf').with_content(/pass4SymmKey = changeme/) }
236236
end
237237

238+
context 'with cluster slave role and custom replication_port' do
239+
let(:params) {
240+
{
241+
:clustering => { 'mode' => 'slave', 'pass4symmkey' => 'changeme', 'cm' => 'splunk-cm.internal.corp.tld:8089' },
242+
:admin => { 'hash' => 'zzzz', 'fn' => 'yyyy', 'email' => 'wwww', },
243+
:dontruncmds => true,
244+
:replication_port => 12345,
245+
}
246+
}
247+
it { should contain_class('splunk::installed') }
248+
it { should contain_package('splunk') }
249+
it { should contain_file('/opt/splunk/etc/apps/puppet_indexer_cluster_slave_base/local/server.conf').with_content(/master_uri = https:\/\/splunk-cm.internal.corp.tld:8089/) }
250+
it { should contain_file('/opt/splunk/etc/apps/puppet_indexer_cluster_pass4symmkey_base/local/server.conf').with_content(/pass4SymmKey = changeme/) }
251+
it { should contain_file('/opt/splunk/etc/apps/puppet_indexer_cluster_slave_base/local/server.conf').with_content(/\[replication_port:\/\/12345\]\ndisabled = false\n/) }
252+
end
253+
238254
context 'with cluster searchhead role' do
239255
let(:params) {
240256
{

templates/puppet_indexer_cluster_slave_base/local/server.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
mode = slave
33
master_uri = https://<%= @cm %>
44

5-
[replication_port://9887]
5+
[replication_port://<%= @replication_port %>]
66
disabled = false

0 commit comments

Comments
 (0)