Skip to content

Commit fd6879e

Browse files
authored
Merge pull request #142 from TraGicCode/feature/alert-actions
Add splunk_alert_actions type.
2 parents 34ca616 + 2aa4876 commit fd6879e

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Puppet::Type.type(:splunk_alert_actions).provide(
2+
:ini_setting,
3+
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
4+
) do
5+
def self.file_name
6+
'system/local/alert_actions.conf'
7+
end
8+
end
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
2+
3+
Puppet::Type.newtype(:splunk_alert_actions) do
4+
@doc = 'Manage splunk alert_actions settings in alert_actions.conf'
5+
PuppetX::Puppetlabs::Splunk::Type.clone_type(self)
6+
end

lib/puppet/type/splunk_config.rb

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
[
2525
:purge_inputs,
2626
:purge_outputs,
27+
:purge_alert_actions,
2728
:purge_authentication,
2829
:purge_authorize,
2930
:purge_distsearch,
@@ -58,6 +59,7 @@ def generate
5859
{
5960
Puppet::Type::Splunk_output => self[:purge_outputs],
6061
Puppet::Type::Splunk_input => self[:purge_inputs],
62+
Puppet::Type::Splunk_alert_actions => self[:purge_alert_actions],
6163
Puppet::Type::Splunk_authentication => self[:purge_authentication],
6264
Puppet::Type::Splunk_authorize => self[:purge_authorize],
6365
Puppet::Type::Splunk_distsearch => self[:purge_distsearch],
@@ -82,6 +84,7 @@ def generate
8284

8385
def set_provider_paths
8486
[
87+
:splunk_alert_actions,
8588
:splunk_authentication,
8689
:splunk_authorize,
8790
:splunk_distsearch,

manifests/init.pp

+12
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
$pkg_provider = $splunk::params::pkg_provider,
5555
$splunkd_listen = '127.0.0.1',
5656
$web_port = '8000',
57+
$purge_alert_actions = false,
5758
$purge_authentication = false,
5859
$purge_authorize = false,
5960
$purge_distsearch = false,
@@ -129,6 +130,7 @@
129130

130131
# Purge resources if option set
131132
Splunk_config['splunk'] {
133+
purge_alert_actions => $purge_alert_actions,
132134
purge_authentication => $purge_authentication,
133135
purge_authorize => $purge_authorize,
134136
purge_distsearch => $purge_distsearch,
@@ -170,6 +172,11 @@
170172
-> File <| tag == 'splunk_server' |>
171173
-> Service[$virtual_service]
172174

175+
Package[$package_name]
176+
-> File <| tag == 'splunk_server' |>
177+
-> Splunk_alert_actions <| tag == 'splunk_server' |>
178+
~> Service[$virtual_service]
179+
173180
Package[$package_name]
174181
-> File <| tag == 'splunk_server' |>
175182
-> Splunk_authentication <| tag == 'splunk_server' |>
@@ -236,6 +243,11 @@
236243
mode => '0600',
237244
}
238245

246+
file { '/opt/splunk/etc/system/local/alert_actions.conf':
247+
ensure => file,
248+
tag => 'splunk_server',
249+
}
250+
239251
file { '/opt/splunk/etc/system/local/authentication.conf':
240252
ensure => file,
241253
tag => 'splunk_server',

0 commit comments

Comments
 (0)