Commit e4a28450 authored by jtimberman's avatar jtimberman
Browse files

cook-114, if the node is a server, don't manage the remote.conf per client

parent bfcec7d3
......@@ -21,18 +21,20 @@ include_recipe "rsyslog"
rsyslog_server = node[:rsyslog][:server] ? node[:rsyslog][:server] : search(:node, "rsyslog_server:true").map { |n| n["fqdn"] }
template "/etc/rsyslog.d/remote.conf" do
source "remote.conf.erb"
backup false
variables :server => rsyslog_server, :protocol => node[:rsyslog][:protocol]
owner "root"
group "root"
mode 0644
notifies :restart, resources(:service => "rsyslog"), :delayed
end
unless node[:rsyslog][:server]
template "/etc/rsyslog.d/remote.conf" do
source "remote.conf.erb"
backup false
variables :server => rsyslog_server, :protocol => node[:rsyslog][:protocol]
owner "root"
group "root"
mode 0644
notifies :restart, resources(:service => "rsyslog"), :delayed
end
file "/etc/rsyslog.d/server.conf" do
action :delete
notifies :reload, resources(:service => "rsyslog"), :delayed
only_if do File.exists?("/etc/rsyslog.d/server.conf") end
file "/etc/rsyslog.d/server.conf" do
action :delete
notifies :reload, resources(:service => "rsyslog"), :delayed
only_if do File.exists?("/etc/rsyslog.d/server.conf") end
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment