Commit 96c1c3ad authored by Tim Smith's avatar Tim Smith
Browse files

Merge pull request #94 from rdoorn/master

if there are no remote syslog servers, just do local config
parents c951f02c 8ff3caf3
......@@ -60,19 +60,19 @@ unless node['rsyslog']['custom_remote'].first.empty?
end
if rsyslog_servers.empty?
Chef::Application.fatal!('The rsyslog::client recipe was unable to determine the remote syslog server. Checked both the server_ip attribute and search!')
end
remote_type = node['rsyslog']['use_relp'] ? 'relp' : 'remote'
Chef::Log.warn('The rsyslog::client recipe was unable to determine the remote syslog server. Checked both the server_ip attribute and search! Not forwarding logs.')
else
remote_type = node['rsyslog']['use_relp'] ? 'relp' : 'remote'
template "#{node['rsyslog']['config_prefix']}/rsyslog.d/49-remote.conf" do
source "49-#{remote_type}.conf.erb"
owner 'root'
group 'root'
mode '0644'
variables(servers: rsyslog_servers)
notifies :restart, "service[#{node['rsyslog']['service_name']}]"
only_if { node['rsyslog']['remote_logs'] }
template "#{node['rsyslog']['config_prefix']}/rsyslog.d/49-remote.conf" do
source "49-#{remote_type}.conf.erb"
owner 'root'
group 'root'
mode '0644'
variables(servers: rsyslog_servers)
notifies :restart, "service[#{node['rsyslog']['service_name']}]"
only_if { node['rsyslog']['remote_logs'] }
end
end
file "#{node['rsyslog']['config_prefix']}/rsyslog.d/server.conf" do
......
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