diff options
author | elijah <elijah@riseup.net> | 2015-04-17 10:24:37 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2015-04-17 10:24:37 -0700 |
commit | f3aa928a91e0172a7a3c940940ab864194cb85a7 (patch) | |
tree | 433c2784c878301dcc36478e32496b9140d4a407 /puppet/modules/leap/manifests | |
parent | 8bd7eca1913a8ca23e8b2c92b83aeac5a665131b (diff) | |
parent | 64cc83793aa35b84b60dd40305c7edf8369a187b (diff) |
Merge branch 'bugfix/logs' into develop
Diffstat (limited to 'puppet/modules/leap/manifests')
-rw-r--r-- | puppet/modules/leap/manifests/init.pp | 3 | ||||
-rw-r--r-- | puppet/modules/leap/manifests/logfile.pp | 26 |
2 files changed, 29 insertions, 0 deletions
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..c5c185f6 --- /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=$name) { + $logfile = "/var/log/leap/${name}.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 5', + 'set schedule daily', + 'set compress compress', + 'set missingok missingok', + 'set ifempty notifempty', + 'set copytruncate copytruncate' + ] + } +} |