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 splunk_server type and provider #34

Merged
merged 2 commits into from
Mar 17, 2016
Merged
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
15 changes: 15 additions & 0 deletions lib/puppet/provider/splunk_server/ini_setting.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Puppet::Type.type(:splunk_server).provide(
:ini_setting,
# set ini_setting as the parent provider
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
# hard code the file path (this allows purging)
def self.file_path
case Facter.value(:osfamily)
when 'windows'
'C:\Program Files\Splunk\etc\system\local\server.conf'
else
'/opt/splunk/etc/system/local/server.conf'
end
end
end
24 changes: 24 additions & 0 deletions lib/puppet/type/splunk_server.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Puppet::Type.newtype(:splunk_server) do
ensurable
newparam(:name, :namevar => true) do
desc 'Setting name to manage from server.conf'
end
newproperty(:value) do
desc 'The value of the setting to be defined.'
munge do |v|
v.to_s.strip
end
end
newproperty(:setting) do
desc 'The setting being defined.'
munge do |v|
v.to_s.strip
end
end
newproperty(:section) do
desc 'The section the setting is defined under.'
munge do |v|
v.to_s.strip
end
end
end