default.rb 1.6 KB
Newer Older
jtimberman's avatar
jtimberman committed
1
2
3
4
#
# Cookbook Name:: rsyslog
# Recipe:: default
#
Matt Ray's avatar
Matt Ray committed
5
# Copyright 2009-2013, Opscode, 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
20
21
22
23
24
# 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.
#

package "rsyslog" do
  action :install
end

directory "/etc/rsyslog.d" do
25
  owner node['rsyslog']['user']
26
  group node['rsyslog']['group']
jtimberman's avatar
jtimberman committed
27
28
29
  mode 0755
end

30
directory "/var/spool/rsyslog" do
31
32
  owner node['rsyslog']['user']
  group node['rsyslog']['group']
33
34
35
  mode 0755
end

36
37
# Our main stub which then does its own rsyslog-specific
# include of things in /etc/rsyslog.d/*
jtimberman's avatar
jtimberman committed
38
template "/etc/rsyslog.conf" do
39
  source 'rsyslog.conf.erb'
40
  owner node['rsyslog']['user']
41
  group node['rsyslog']['group']
jtimberman's avatar
jtimberman committed
42
  mode 0644
43
  variables(:protocol => node['rsyslog']['protocol'])
44
  notifies :restart, "service[#{node['rsyslog']['service_name']}]"
jtimberman's avatar
jtimberman committed
45
end
46

47
48
49
template "/etc/rsyslog.d/50-default.conf" do
  source "50-default.conf.erb"
  backup false
50
  owner node['rsyslog']['user']
51
52
  group node['rsyslog']['group']
  mode 0644
53
  notifies :restart, "service[#{node['rsyslog']['service_name']}]"
54
end
55

Tim Smith's avatar
Tim Smith committed
56
service node['rsyslog']['service_name'] do
57
  supports :restart => true, :reload => true, :status => true
58
59
  action [:enable, :start]
end