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

Added splunkforwarder_server and splunkforwarder_limits providers/types. #118

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ the inputs.conf file and refresh the service.
* `splunkforwarder_props`: Used to manage ini settings in [props.conf][props.conf-docs]
* `splunkforwarder_transforms`: Used to manage ini settings in [transforms.conf][transforms.conf-docs]
* `splunkforwarder_web`: Used to manage ini settings in [web.conf][web.conf-docs]
* `splunkforwarder_limits`: Used to manage ini settings in [limits.conf][limits.conf-docs]
* `splunkforwarder_server`: Used to manage ini settings in [server.conf][server.conf-docs]

All of the above types use `puppetlabs/ini_file` as a parent and are declared in
an identical way, and accept the following parameters:
Expand Down
8 changes: 8 additions & 0 deletions lib/puppet/provider/splunkforwarder_limits/ini_setting.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Puppet::Type.type(:splunkforwarder_limits).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
) do
def self.file_name
'limits.conf'
end
end
8 changes: 8 additions & 0 deletions lib/puppet/provider/splunkforwarder_server/ini_setting.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Puppet::Type.type(:splunkforwarder_server).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
) do
def self.file_name
'server.conf'
end
end
6 changes: 6 additions & 0 deletions lib/puppet/type/splunkforwarder_limits.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')

Puppet::Type.newtype(:splunkforwarder_limits) do
@doc = 'Manage splunkforwarder limit settings in limits.conf'
PuppetX::Puppetlabs::Splunk::Type.clone_type(self)
end
6 changes: 6 additions & 0 deletions lib/puppet/type/splunkforwarder_server.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')

Puppet::Type.newtype(:splunkforwarder_server) do
@doc = 'Manage splunkforwarder server settings in server.conf'
PuppetX::Puppetlabs::Splunk::Type.clone_type(self)
end
12 changes: 12 additions & 0 deletions manifests/forwarder.pp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@
Package[$package_name] -> Splunkforwarder_props<||> ~> Service[$virtual_service]
Package[$package_name] -> Splunkforwarder_transforms<||> ~> Service[$virtual_service]
Package[$package_name] -> Splunkforwarder_web<||> ~> Service[$virtual_service]
Package[$package_name] -> Splunkforwarder_limits<||> ~> Service[$virtual_service]
Package[$package_name] -> Splunkforwarder_server<||> ~> Service[$virtual_service]

File {
owner => $splunk_user,
Expand All @@ -185,6 +187,16 @@
tag => 'splunk_forwarder',
}

file { "${forwarder_confdir}/system/local/limits.conf":
ensure => file,
tag => 'splunk_forwarder',
}

file { "${forwarder_confdir}/system/local/server.conf":
ensure => file,
tag => 'splunk_forwarder',
}

# Validate: if both Splunk and Splunk Universal Forwarder are installed on
# the same system, then they must use different admin ports.
if (defined(Class['splunk']) and defined(Class['splunk::forwarder'])) {
Expand Down