default.rb 5.28 KB
Newer Older
jtimberman's avatar
jtimberman committed
1
2
#
# Cookbook Name:: rsyslog
3
# Attributes:: default
jtimberman's avatar
jtimberman committed
4
#
Tim Smith's avatar
Tim Smith committed
5
# Copyright 2009-2014, Chef Software, Inc.
jtimberman's avatar
jtimberman committed
6
7
8
9
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
10
#
jtimberman's avatar
jtimberman committed
11
#     http://www.apache.org/licenses/LICENSE-2.0
12
#
jtimberman's avatar
jtimberman committed
13
14
15
16
17
18
19
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

20
default['rsyslog']['log_dir']                   = '/srv/rsyslog'
21
default['rsyslog']['working_dir']               = '/var/spool/rsyslog'
22
default['rsyslog']['server']                    = false
23
default['rsyslog']['use_relp']                  = false
24
default['rsyslog']['relp_port']                 = 20_514
25
26
27
28
29
30
31
32
33
34
35
default['rsyslog']['protocol']                  = 'tcp'
default['rsyslog']['port']                      = 514
default['rsyslog']['server_ip']                 = nil
default['rsyslog']['server_search']             = 'role:loghost'
default['rsyslog']['remote_logs']               = true
default['rsyslog']['per_host_dir']              = '%$YEAR%/%$MONTH%/%$DAY%/%HOSTNAME%'
default['rsyslog']['max_message_size']          = '2k'
default['rsyslog']['preserve_fqdn']             = 'off'
default['rsyslog']['high_precision_timestamps'] = false
default['rsyslog']['repeated_msg_reduction']    = 'on'
default['rsyslog']['logs_to_forward']           = '*.*'
Dan Buch's avatar
Dan Buch committed
36
37
default['rsyslog']['enable_imklog']             = true
default['rsyslog']['config_prefix']             = '/etc'
38
39
default['rsyslog']['default_file_template']    = nil
default['rsyslog']['default_remote_template']   = nil
40
41
default['rsyslog']['rate_limit_interval']       = nil
default['rsyslog']['rate_limit_burst']          = nil
42
default['rsyslog']['enable_tls']                = false
43
default['rsyslog']['action_queue_max_disk_space'] = '1G'
44
45
46
47
default['rsyslog']['tls_ca_file']               = nil
default['rsyslog']['tls_certificate_file']      = nil
default['rsyslog']['tls_key_file']              = nil
default['rsyslog']['tls_auth_mode']             = 'anon'
48
default['rsyslog']['use_local_ipv4']            = false
Jeff Blaine's avatar
Jeff Blaine committed
49
50

# The most likely platform-specific attributes
51
52
53
54
default['rsyslog']['service_name']              = 'rsyslog'
default['rsyslog']['user']                      = 'root'
default['rsyslog']['group']                     = 'adm'
default['rsyslog']['priv_seperation']           = false
Dan Buch's avatar
Dan Buch committed
55
default['rsyslog']['modules']                   = %w(imuxsock imklog)
56

57
58
case node['platform']
when 'ubuntu'
59
  # syslog user introduced with natty package
60
  if node['platform_version'].to_f >= 11.04
61
62
63
    default['rsyslog']['user'] = 'syslog'
    default['rsyslog']['group'] = 'adm'
    default['rsyslog']['priv_seperation'] = true
64
  end
65
66
when 'arch'
  default['rsyslog']['service_name'] = 'rsyslogd'
Dan Buch's avatar
Dan Buch committed
67
68
69
when 'smartos'
  default['rsyslog']['config_prefix'] = '/opt/local/etc'
  default['rsyslog']['modules'] = %w(immark imsolaris imtcp imudp)
70
71
72
73
  default['rsyslog']['group'] = 'root'
when 'omnios'
  default['rsyslog']['service_name'] = 'system/rsyslogd'
  default['rsyslog']['modules'] = %w(immark imsolaris imtcp imudp)
Dan Buch's avatar
Dan Buch committed
74
  default['rsyslog']['group'] = 'root'
Jean-Francois Theroux's avatar
Jean-Francois Theroux committed
75
76
when 'suse'
  default['rsyslog']['service_name'] = 'syslog'
77
end
78
79
80
81
82
83
84
85
86

# 50-default template attributes

default['rsyslog']['default_log_dir'] = '/var/log'
case node['platform_family']
when 'rhel'
  # format { facility => destination }
  default['rsyslog']['default_facility_logs'] = {
    '*.info;mail.none;authpriv.none;cron.none' => "#{node['rsyslog']['default_log_dir']}/messages",
87
    'authpriv.*' => "#{node['rsyslog']['default_log_dir']}/secure",
88
89
90
91
    'mail.*' => "-#{node['rsyslog']['default_log_dir']}/maillog",
    'cron.*' => "#{node['rsyslog']['default_log_dir']}/cron",
    '*.emerg' => '*',
    'uucp,news.crit' => "#{node['rsyslog']['default_log_dir']}/spooler",
92
    'local7.*' => "#{node['rsyslog']['default_log_dir']}/boot.log"
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
  }
else
  # format { facility => destination }
  default['rsyslog']['default_facility_logs'] = {
    'auth,authpriv.*' => "#{node['rsyslog']['default_log_dir']}/auth.log",
    '*.*;auth,authpriv.none' => "-#{node['rsyslog']['default_log_dir']}/syslog",
    'daemon.*' => "-#{node['rsyslog']['default_log_dir']}/daemon.log",
    'kern.*' => "-#{node['rsyslog']['default_log_dir']}/kern.log",
    'mail.*' => "-#{node['rsyslog']['default_log_dir']}/mail.log",
    'user.*' => "-#{node['rsyslog']['default_log_dir']}/user.log",
    'mail.info' => "-#{node['rsyslog']['default_log_dir']}/mail.info",
    'mail.warn' => "-#{node['rsyslog']['default_log_dir']}/mail.warn",
    'mail.err' => "#{node['rsyslog']['default_log_dir']}/mail.err",
    'news.crit' => "#{node['rsyslog']['default_log_dir']}/news/news.crit",
    'news.err' => "#{node['rsyslog']['default_log_dir']}/news/news.err",
    'news.notice' => "-#{node['rsyslog']['default_log_dir']}/news/news.notice",
    '*.=debug;auth,authpriv.none;news.none;mail.none' => "-#{node['rsyslog']['default_log_dir']}/debug",
    '*.=info;*.=notice;*.=warn;auth,authpriv.none;cron,daemon.none;mail,news.none' => "-#{node['rsyslog']['default_log_dir']}/messages",
    '*.emerg' => '*',
    'daemon.*;mail.*;news.err;*.=debug;*.=info;*.=notice;*.=warn' => '|/dev/xconsole'
  }
end