From 82f785f84c694e5faf8611875ec19b4a2125a9e7 Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Tue, 18 Oct 2016 12:11:09 +0200 Subject: [PATCH] afegit logrotate --- CHANGELOG.md | 3 +++ README.md | 6 ++++++ manifests/init.pp | 22 ++++++++++++++++++---- metadata.json | 2 +- 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4591f22..64d8f85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,5 @@ # CHANGELOG +## 0.1.6 + +* logrotate configuration file using eyp-logrotate (manage_logrotate=>false to disable) diff --git a/README.md b/README.md index f21e3dc..1eff685 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,12 @@ class { 'audit::tty': } * **buffers**: buffers to survive stress events (default: 320) * **add_default_rules**: add the following default rules - it will apply b64 only if is applicable, same for /etc/sysconfig/network (default: true) +* **manage_logrotate**: add logrotate config file (default: true) +* **logrotate_rotate** = '4', +* **logrotate_compress** = true, +* **logrotate_missingok** = true, +* **logrotate_notifempty** = true, + ``` -w /var/tmp -p x -w /tmp -p x diff --git a/manifests/init.pp b/manifests/init.pp index a74f81c..8ca7315 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,8 +1,13 @@ # == Class: audit # class audit ( - $buffers='320', - $add_default_rules=true, + $buffers = '320', + $add_default_rules = true, + $manage_logrotate = true, + $logrotate_rotate = '4', + $logrotate_compress = true, + $logrotate_missingok = true, + $logrotate_notifempty = true, ) inherits audit::params { package { $audit::params::pkg_audit: @@ -41,6 +46,15 @@ } } - - + if($manage_logrotate) + { + logrotate::logs { 'audit': + ensure => present, + log => [ '/var/log/audit/audit.log' ], + rotate => '4', + compress => true, + missingok => true, + notifempty => true, + } + } } diff --git a/metadata.json b/metadata.json index 5cadd45..3cda850 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "eyp-audit", - "version": "0.1.5", + "version": "0.1.6", "author": "eyp", "summary": "basic auditd support", "license": "Apache-2.0",