From 91a2b30dd703c827deebfb69f1b5561773beac00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Wed, 10 Aug 2016 22:10:25 +0200 Subject: Add logrotate --- modules/base_configuration/manifests/init.pp | 33 ++++++++++++++++++++++++++++ modules/logrotate | 1 + 2 files changed, 34 insertions(+) create mode 160000 modules/logrotate (limited to 'modules') diff --git a/modules/base_configuration/manifests/init.pp b/modules/base_configuration/manifests/init.pp index f432e29..2b20a0e 100644 --- a/modules/base_configuration/manifests/init.pp +++ b/modules/base_configuration/manifests/init.pp @@ -59,6 +59,39 @@ class base_configuration ( include => '/etc/pacman.d/mirrorlist' } + class { '::logrotate': + manage_cron_daily => false, + config => { + rotate_every => 'week', + rotate => 4, + create => true, + compress => true, + olddir => '/var/log/old', + tabooext => "+ .pacorig .pacnew .pacsave", + } + } + + logrotate::rule { 'wtmp': + path => '/var/log/wtmp', + rotate_every => 'month', + create => true, + create_mode => '0664', + create_owner => 'root', + create_group => 'utmp', + rotate => '1', + minsize => '1M', + } + logrotate::rule { 'btmp': + path => '/var/log/btmp', + missingok => true, + rotate_every => 'month', + create => true, + create_mode => '0600', + create_owner => 'root', + create_group => 'utmp', + rotate => '1', + } + ensure_packages(["whois"], { 'install_options' => '--asdeps' }) class { 'fail2ban': logtarget => 'SYSLOG', diff --git a/modules/logrotate b/modules/logrotate new file mode 160000 index 0000000..ad87cf8 --- /dev/null +++ b/modules/logrotate @@ -0,0 +1 @@ +Subproject commit ad87cf8b589d60bdbd1bb6e9059a5bf742235ec3 -- cgit v1.2.3