Skip to content

Commit a4063f0

Browse files
committed
Merge pull request #12 from biola/chef11fixes
Simplified forwarder inputs.conf deployment for Chef 11
2 parents 9c05276 + 01336cf commit a4063f0

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

recipes/forwarder.rb

+7-13
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,13 @@
138138
end
139139
end
140140

141-
# Find the inputs file to move. There will be the default and then we will over-write it as necessary
142-
node.cookbook_collection[node['splunk']['cookbook_name']].template_filenames.each do |filename|
143-
inputsfile = "forwarder/#{node['splunk']['forwarder_config_folder']}/#{node['splunk']['forwarder_role']}.inputs.conf.erb"
144-
if inputsfile == filename
145-
template "Moving inputs file for role: #{node['splunk']['forwarder_role']}" do
146-
path "#{node['splunk']['forwarder_home']}/etc/system/local/inputs.conf"
147-
source inputsfile
148-
owner "root"
149-
group "root"
150-
mode "0640"
151-
notifies :restart, resources(:service => "splunk")
152-
end
153-
end
141+
template "Moving inputs file for role: #{node['splunk']['forwarder_role']}" do
142+
path "#{node['splunk']['forwarder_home']}/etc/system/local/inputs.conf"
143+
source "forwarder/#{node['splunk']['forwarder_config_folder']}/#{node['splunk']['forwarder_role']}.inputs.conf.erb"
144+
owner "root"
145+
group "root"
146+
mode "0640"
147+
notifies :restart, resources(:service => "splunk")
154148
end
155149

156150

0 commit comments

Comments
 (0)