Commit 90164865 authored by Jeff Blaine's avatar Jeff Blaine Committed by jtimberman
Browse files

No more special-case (full /etc/rsyslog.conf) for non-ubuntu

RHEL6 and I'm pretty sure any rsyslog from the last few years
supports the notion of /etc/rsyslog.d/* files which can be
included from the main /etc/rsyslog.conf file, so the special
case in the template where non-Ubuntu would get a complete
/etc/rsyslog.conf has been removed. This means all hosts will
get the 50-default.conf and not just Ubuntu hosts. There was
nothing Ubuntu-specific about it at all, and so it is moved
into templates/default from templates/ubuntu.

Also removed the Ubuntu 8.04 special apt get stuff due to
age.
parent 0289af00
......@@ -17,32 +17,20 @@
# limitations under the License.
#
if platform?("ubuntu") && node['platform_version'].to_f == 8.04
apt_repository "hardy-rsyslog-ppa" do
uri "http://ppa.launchpad.net/a.bono/rsyslog/ubuntu"
distribution "hardy"
components ["main"]
keyserver "keyserver.ubuntu.com"
key "C0061A4A"
action :add
notifies :run, "execute[apt-get update]", :immediately
end
end
package "rsyslog" do
action :install
end
cookbook_file "#{node["rsyslog"]["defaults_file"]}" do
source "rsyslog.default"
owner node["rsyslog"]["owner"]
group node["rsyslog"]["group"]
owner node['rsyslog']['owner']
group node['rsyslog']['group']
mode 0644
end
directory "/etc/rsyslog.d" do
owner node["rsyslog"]["owner"]
group node["rsyslog"]["group"]
owner node['rsyslog']['owner']
group node['rsyslog']['group']
mode 0755
end
......@@ -52,27 +40,26 @@ directory "/var/spool/rsyslog" do
mode 0755
end
# Our main stub which then does its own rsyslog-specific
# include of things in /etc/rsyslog.d/*
template "/etc/rsyslog.conf" do
source "rsyslog.conf.erb"
owner node["rsyslog"]["owner"]
group node["rsyslog"]["group"]
source 'rsyslog.conf.erb'
owner node['rsyslog']['owner']
group node['rsyslog']['group']
mode 0644
variables(:protocol => node['rsyslog']['protocol'])
notifies :restart, "service[rsyslog]"
notifies :restart, 'service[rsyslog]'
end
if platform?("ubuntu")
template "/etc/rsyslog.d/50-default.conf" do
source "50-default.conf.erb"
backup false
owner node["rsyslog"]["owner"]
group node["rsyslog"]["group"]
mode 0644
notifies :restart, "service[rsyslog]"
end
template "/etc/rsyslog.d/50-default.conf" do
source "50-default.conf.erb"
backup false
owner node['rsyslog']['owner']
group node['rsyslog']['group']
mode 0644
end
service "#{node["rsyslog"]["service_name"]}" do
service "#{node['rsyslog']['service_name']}" do
supports :restart => true, :reload => true
action [:enable, :start]
end
......@@ -62,74 +62,3 @@ $PrivDropToGroup <%= node['rsyslog']['group'] %>
# Include all config files in /etc/rsyslog.d/
#
$IncludeConfig /etc/rsyslog.d/*.conf
<% unless node[:platform] == 'ubuntu' -%>
###############
#### RULES ####
###############
#
# First some standard log files. Log by facility.
#
auth,authpriv.* /var/log/auth.log
*.*;auth,authpriv.none -/var/log/syslog
#cron.* /var/log/cron.log
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
lpr.* -/var/log/lpr.log
mail.* -/var/log/mail.log
user.* -/var/log/user.log
#
# Logging for the mail system. Split it up so that
# it is easy to write scripts to parse these files.
#
mail.info -/var/log/mail.info
mail.warn -/var/log/mail.warn
mail.err /var/log/mail.err
#
# Logging for INN news system.
#
news.crit /var/log/news/news.crit
news.err /var/log/news/news.err
news.notice -/var/log/news/news.notice
#
# Some "catch-all" log files.
#
*.=debug;\
auth,authpriv.none;\
news.none;mail.none -/var/log/debug
*.=info;*.=notice;*.=warn;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none -/var/log/messages
#
# Emergencies are sent to everybody logged in.
#
*.emerg *
#
# I like to have messages displayed on the console, but only on a virtual
# console I usually leave idle.
#
#daemon,mail.*;\
# news.=crit;news.=err;news.=notice;\
# *.=debug;*.=info;\
# *.=notice;*.=warn /dev/tty8
# The named pipe /dev/xconsole is for the `xconsole' utility. To use it,
# you must invoke `xconsole' with the `-file' option:
#
# $ xconsole -file /dev/xconsole [...]
#
# NOTE: adjust the list below, or you'll go crazy if you have a reasonably
# busy site..
#
daemon.*;mail.*;\
news.err;\
*.=debug;*.=info;\
*.=notice;*.=warn |/dev/xconsole
<% 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