From bb07407485ed1626221a1190cc2fb2789f95ed22 Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 15 Apr 2015 16:12:11 -0700 Subject: clean up logging mess: add 'logfile' define, mv openvpn and stunnel logs to their own files, fix mx logwatch path. --- puppet/modules/leap/manifests/init.pp | 3 +++ puppet/modules/leap/manifests/logfile.pp | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 puppet/modules/leap/manifests/init.pp create mode 100644 puppet/modules/leap/manifests/logfile.pp (limited to 'puppet/modules/leap') diff --git a/puppet/modules/leap/manifests/init.pp b/puppet/modules/leap/manifests/init.pp new file mode 100644 index 00000000..bbae3781 --- /dev/null +++ b/puppet/modules/leap/manifests/init.pp @@ -0,0 +1,3 @@ +class leap { + +} \ No newline at end of file diff --git a/puppet/modules/leap/manifests/logfile.pp b/puppet/modules/leap/manifests/logfile.pp new file mode 100644 index 00000000..42a82943 --- /dev/null +++ b/puppet/modules/leap/manifests/logfile.pp @@ -0,0 +1,26 @@ +# +# make syslog log to a particular file for a particular process. +# + +define leap::logfile($process=$title) { + $logfile = "/var/log/leap/${title}.log" + + rsyslog::snippet { "50-${name}": + content => "if \$programname startswith '${process}' then ${logfile} +&~" + } + + augeas { + "logrotate_${name}": + context => "/files/etc/logrotate.d/${name}/rule", + changes => [ + "set file ${logfile}", + 'set rotate 7', + 'set schedule daily', + 'set compress compress', + 'set missingok missingok', + 'set ifempty notifempty', + 'set copytruncate copytruncate' + ] + } +} -- cgit v1.2.3 From e97a00725c80a4067d5bba24d931b1a3bcf2ad96 Mon Sep 17 00:00:00 2001 From: elijah Date: Thu, 16 Apr 2015 20:57:26 -0700 Subject: keep five log files instead of seven. --- puppet/modules/leap/manifests/logfile.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'puppet/modules/leap') diff --git a/puppet/modules/leap/manifests/logfile.pp b/puppet/modules/leap/manifests/logfile.pp index 42a82943..4deafacb 100644 --- a/puppet/modules/leap/manifests/logfile.pp +++ b/puppet/modules/leap/manifests/logfile.pp @@ -15,7 +15,7 @@ define leap::logfile($process=$title) { context => "/files/etc/logrotate.d/${name}/rule", changes => [ "set file ${logfile}", - 'set rotate 7', + 'set rotate 5', 'set schedule daily', 'set compress compress', 'set missingok missingok', -- cgit v1.2.3 From 64cc83793aa35b84b60dd40305c7edf8369a187b Mon Sep 17 00:00:00 2001 From: elijah Date: Fri, 17 Apr 2015 10:19:37 -0700 Subject: rename leap-mx logrotate file; minor style change. --- puppet/modules/leap/manifests/logfile.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'puppet/modules/leap') diff --git a/puppet/modules/leap/manifests/logfile.pp b/puppet/modules/leap/manifests/logfile.pp index 4deafacb..c5c185f6 100644 --- a/puppet/modules/leap/manifests/logfile.pp +++ b/puppet/modules/leap/manifests/logfile.pp @@ -2,8 +2,8 @@ # make syslog log to a particular file for a particular process. # -define leap::logfile($process=$title) { - $logfile = "/var/log/leap/${title}.log" +define leap::logfile($process=$name) { + $logfile = "/var/log/leap/${name}.log" rsyslog::snippet { "50-${name}": content => "if \$programname startswith '${process}' then ${logfile} -- cgit v1.2.3