From 663fe4574674bdeaf2e8c749e7e46d3fe1e6c2e4 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 13 Jan 2015 10:23:48 -0500 Subject: Configure rsyslog to put leap-mx logs into /var/log/leap/mx.log, and setup logrotation (#6637) Change-Id: I873517b2d99f5b55289728969b49d5405da7d4c6 --- puppet/modules/leap_mx/manifests/init.pp | 3 ++- puppet/modules/leap_mx/manifests/syslog.pp | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 puppet/modules/leap_mx/manifests/syslog.pp (limited to 'puppet/modules/leap_mx/manifests') diff --git a/puppet/modules/leap_mx/manifests/init.pp b/puppet/modules/leap_mx/manifests/init.pp index c90fc231..c2cc96c6 100644 --- a/puppet/modules/leap_mx/manifests/init.pp +++ b/puppet/modules/leap_mx/manifests/init.pp @@ -9,7 +9,8 @@ class leap_mx { include soledad::common include site_apt::preferences::twisted - + include leap_mx::syslog + # # USER AND GROUP # diff --git a/puppet/modules/leap_mx/manifests/syslog.pp b/puppet/modules/leap_mx/manifests/syslog.pp new file mode 100644 index 00000000..0247a392 --- /dev/null +++ b/puppet/modules/leap_mx/manifests/syslog.pp @@ -0,0 +1,17 @@ +class leap_mx::syslog { + + rsyslog::snippet { '99-leap-mx': + content => 'if $programname startswith \'leap-mx\' then /var/log/leap/mx.log +&~' + } + + augeas { + 'logrotate_leap-mx': + context => '/files/etc/logrotate.d/leap-mx/rule', + changes => [ 'set file /var/log/leap/mx*.log', 'set rotate 7', + 'set schedule daily', 'set compress compress', + 'set missingok missingok', 'set ifempty notifempty', + 'set copytruncate copytruncate' ] + } + +} -- cgit v1.2.3