summaryrefslogtreecommitdiff
path: root/puppet
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2016-02-02 10:21:49 -0800
committerelijah <elijah@riseup.net>2016-02-02 10:21:49 -0800
commit45e81ca4abc81600998f11a5e74a565f545e6c84 (patch)
tree832044b8ca8eb14aa09aefcb78ed1a25f9f77200 /puppet
parentedc9aa13f5ebb07f27e73fd4befc5fbbadfebc66 (diff)
finally fix leap-mx logging, for the last time, hopefully.
Diffstat (limited to 'puppet')
-rw-r--r--puppet/modules/leap/manifests/logfile.pp15
-rw-r--r--puppet/modules/leap_mx/manifests/init.pp5
-rw-r--r--puppet/modules/site_config/manifests/remove/files.pp7
3 files changed, 18 insertions, 9 deletions
diff --git a/puppet/modules/leap/manifests/logfile.pp b/puppet/modules/leap/manifests/logfile.pp
index 63dbd16b..adb3ca8a 100644
--- a/puppet/modules/leap/manifests/logfile.pp
+++ b/puppet/modules/leap/manifests/logfile.pp
@@ -1,9 +1,18 @@
#
# make syslog log to a particular file for a particular process.
#
-
-define leap::logfile($process=$name) {
- $logfile = "/var/log/leap/${name}.log"
+# arguments:
+#
+# * name: what config files are named as (eg. /etc/rsyslog.d/50-$name.conf)
+# * log: the full path of the log file (defaults to /var/log/leap/$name.log
+# * process: the syslog tag to filter on (defaults to name)
+#
+define leap::logfile($process = $name, $log = undef) {
+ if $log {
+ $logfile = $log
+ } else {
+ $logfile = "/var/log/leap/${name}.log"
+ }
rsyslog::snippet { "50-${name}":
content => template('leap/rsyslog.erb')
diff --git a/puppet/modules/leap_mx/manifests/init.pp b/puppet/modules/leap_mx/manifests/init.pp
index 50bc8a18..6bdcec42 100644
--- a/puppet/modules/leap_mx/manifests/init.pp
+++ b/puppet/modules/leap_mx/manifests/init.pp
@@ -85,7 +85,10 @@ class leap_mx {
notify => Service['leap-mx'];
}
- leap::logfile { 'mx': process => 'leap-mx' }
+ leap::logfile { 'leap-mx':
+ log => '/var/log/leap/mx.log',
+ process => 'leap-mx'
+ }
#
# LEAP-MX CODE AND DEPENDENCIES
diff --git a/puppet/modules/site_config/manifests/remove/files.pp b/puppet/modules/site_config/manifests/remove/files.pp
index 4f7aa6e6..3efcbf0f 100644
--- a/puppet/modules/site_config/manifests/remove/files.pp
+++ b/puppet/modules/site_config/manifests/remove/files.pp
@@ -15,6 +15,7 @@ class site_config::remove::files {
tidy {
'/etc/default/leap_mx':;
'/etc/logrotate.d/mx':;
+ '/etc/rsyslog.d/50-mx.conf':;
}
#
@@ -30,11 +31,7 @@ class site_config::remove::files {
'leap_mx':
path => '/var/log/',
recurse => true,
- matches => 'leap_mx*';
- 'mx':
- path => '/var/log/leap/',
- recurse => true,
- matches => 'mx.log*';
+ matches => ['leap_mx*', 'mx.log.[6-9](.gz)?', 'mx.log.[0-9][0-9](.gz)?'];
'/srv/leap/webapp/public/provider.json':;
'/srv/leap/couchdb/designs/tmp_users':
recurse => true,