Commit 7db9a03a authored by Jennifer Davis's avatar Jennifer Davis
Browse files

merging conflicts

parent 5ab09ca4
...@@ -52,18 +52,19 @@ if rsyslog_servers.empty? ...@@ -52,18 +52,19 @@ if rsyslog_servers.empty?
else else
remote_type = node['rsyslog']['use_relp'] ? 'relp' : 'remote' remote_type = node['rsyslog']['use_relp'] ? 'relp' : 'remote'
template "#{node['rsyslog']['config_prefix']}/rsyslog.d/49-remote.conf" do template "#{node['rsyslog']['config_prefix']}/rsyslog.d/49-remote.conf" do
source "49-#{remote_type}.conf.erb" source "49-#{remote_type}.conf.erb"
owner 'root' owner 'root'
group 'root' group 'root'
mode '0644' mode '0644'
variables(servers: rsyslog_servers) variables(:servers => rsyslog_servers)
notifies :restart, "service[#{node['rsyslog']['service_name']}]" notifies :run, 'execute[validate_config]'
only_if { node['rsyslog']['remote_logs'] } notifies :restart, "service[#{node['rsyslog']['service_name']}]"
end only_if { node['rsyslog']['remote_logs'] }
end end
file "#{node['rsyslog']['config_prefix']}/rsyslog.d/server.conf" do file "#{node['rsyslog']['config_prefix']}/rsyslog.d/server.conf" do
action :delete action :delete
notifies :run, 'execute[validate_config]'
notifies :restart, "service[#{node['rsyslog']['service_name']}]" notifies :restart, "service[#{node['rsyslog']['service_name']}]"
end end
...@@ -39,6 +39,11 @@ directory node['rsyslog']['working_dir'] do ...@@ -39,6 +39,11 @@ directory node['rsyslog']['working_dir'] do
mode '0700' mode '0700'
end end
execute 'validate_config' do
command "rsyslogd -N 1 -f #{node['rsyslog']['config_prefix']}/rsyslog.conf"
action :nothing
end
# Our main stub which then does its own rsyslog-specific # Our main stub which then does its own rsyslog-specific
# include of things in /etc/rsyslog.d/* # include of things in /etc/rsyslog.d/*
template "#{node['rsyslog']['config_prefix']}/rsyslog.conf" do template "#{node['rsyslog']['config_prefix']}/rsyslog.conf" do
...@@ -46,6 +51,7 @@ template "#{node['rsyslog']['config_prefix']}/rsyslog.conf" do ...@@ -46,6 +51,7 @@ template "#{node['rsyslog']['config_prefix']}/rsyslog.conf" do
owner 'root' owner 'root'
group 'root' group 'root'
mode '0644' mode '0644'
notifies :run, 'execute[validate_config]'
notifies :restart, "service[#{node['rsyslog']['service_name']}]" notifies :restart, "service[#{node['rsyslog']['service_name']}]"
end end
...@@ -54,6 +60,7 @@ template "#{node['rsyslog']['config_prefix']}/rsyslog.d/50-default.conf" do ...@@ -54,6 +60,7 @@ template "#{node['rsyslog']['config_prefix']}/rsyslog.d/50-default.conf" do
owner 'root' owner 'root'
group 'root' group 'root'
mode '0644' mode '0644'
notifies :run, 'execute[validate_config]'
notifies :restart, "service[#{node['rsyslog']['service_name']}]" notifies :restart, "service[#{node['rsyslog']['service_name']}]"
end end
......
...@@ -34,12 +34,14 @@ template "#{node['rsyslog']['config_prefix']}/rsyslog.d/35-server-per-host.conf" ...@@ -34,12 +34,14 @@ template "#{node['rsyslog']['config_prefix']}/rsyslog.d/35-server-per-host.conf"
owner 'root' owner 'root'
group 'root' group 'root'
mode '0644' mode '0644'
notifies :run, 'execute[validate_config]'
notifies :restart, "service[#{node['rsyslog']['service_name']}]" notifies :restart, "service[#{node['rsyslog']['service_name']}]"
end end
# if we're a server we shouldn't be sending logs to a remote like a client # if we're a server we shouldn't be sending logs to a remote like a client
file "#{node['rsyslog']['config_prefix']}/rsyslog.d/remote.conf" do file "#{node['rsyslog']['config_prefix']}/rsyslog.d/remote.conf" do
action :delete action :delete
notifies :run, 'execute[validate_config]'
notifies :restart, "service[#{node['rsyslog']['service_name']}]" notifies :restart, "service[#{node['rsyslog']['service_name']}]"
only_if { ::File.exist?("#{node['rsyslog']['config_prefix']}/rsyslog.d/remote.conf") } only_if { ::File.exist?("#{node['rsyslog']['config_prefix']}/rsyslog.d/remote.conf") }
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