Let permissions of template resources be configured through attributes

Signed-off-by: default avatarStefan Wessels Beljaars <swesselsbeljaars@schubergphilis.com>
parent 611199c3
......@@ -69,6 +69,9 @@ default['rsyslog']['dir_create_mode'] = '0755'
default['rsyslog']['umask'] = '0022'
default['rsyslog']['dir_owner'] = 'root'
default['rsyslog']['dir_group'] = 'adm'
default['rsyslog']['config_files']['owner'] = 'root'
default['rsyslog']['config_files']['group'] = 'root'
default['rsyslog']['config_files']['mode'] = '0644'
# platform specific attributes
case node['platform']
......
......@@ -4,7 +4,7 @@ maintainer_email 'cookbooks@chef.io'
license 'Apache-2.0'
description 'Installs and configures rsyslog'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '6.0.1'
version '6.0.2'
recipe 'rsyslog', 'Sets up rsyslog for local logging'
recipe 'rsyslog::client', 'Sets up a client to log to a remote rsyslog server'
......
......@@ -46,18 +46,18 @@ end
# include of things in /etc/rsyslog.d/*
template "#{node['rsyslog']['config_prefix']}/rsyslog.conf" do
source 'rsyslog.conf.erb'
owner 'root'
group 'root'
mode '0644'
owner node['rsyslog']['config_files']['owner']
group node['rsyslog']['config_files']['group']
mode node['rsyslog']['config_files']['mode']
notifies :run, 'execute[validate_config]'
notifies :restart, "service[#{node['rsyslog']['service_name']}]"
end
template "#{node['rsyslog']['config_prefix']}/rsyslog.d/50-default.conf" do
source '50-default.conf.erb'
owner 'root'
group 'root'
mode '0644'
owner node['rsyslog']['config_files']['owner']
group node['rsyslog']['config_files']['group']
mode node['rsyslog']['config_files']['mode']
notifies :run, 'execute[validate_config]'
notifies :restart, "service[#{node['rsyslog']['service_name']}]"
end
......
......@@ -31,9 +31,9 @@ end
template "#{node['rsyslog']['config_prefix']}/rsyslog.d/35-server-per-host.conf" do
source '35-server-per-host.conf.erb'
owner 'root'
group 'root'
mode '0644'
owner node['rsyslog']['config_files']['owner']
group node['rsyslog']['config_files']['group']
mode node['rsyslog']['config_files']['mode']
notifies :run, 'execute[validate_config]'
notifies :restart, "service[#{node['rsyslog']['service_name']}]"
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