Forge Home

logrotate

Puppet module for logrotate

48,102 downloads

7,105 latest version

3.8 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 2.0.19 (latest)
  • 2.0.18
  • 2.0.17
  • 2.0.16
  • 2.0.15
  • 2.0.14
  • 2.0.13
  • 2.0.12
  • 2.0.11
released Aug 12th 2016
This module has been deprecated by its author since Oct 28th 2019.

The reason given was: No longer maintained

The author has suggested puppet-logrotate as its replacement.

Start using this module

Documentation

example42/logrotate — version 2.0.19 Aug 12th 2016

Deprecation notice

This module was designed for Puppet versions 2 and 3. It should work also on Puppet 4 but doesn't use any of its features.

The current Puppet 3 compatible codebase is no longer actively maintained by example42.

Still, Pull Requests that fix bugs or introduce backwards compatible features will be accepted.

Puppet module: logrotate

This is a Puppet module for logrotate It provides only package installation and file configuration.

Based on Example42 layouts by Alessandro Franceschi / Lab42

Official site: http://www.example42.com

Official git repository: http://github.com/example42/puppet-logrotate

The logrotate::rule define has been adapted from:

https://github.com/rodjek/puppet-logrotate/blob/master/templates/etc/logrotate.d/rule.erb

Released with this licence: https://github.com/rodjek/puppet-logrotate/blob/master/LICENSE

The logrotate::conf define has been adapted from:

https://github.com/arioch/puppet-logrotate/blob/master/manifests/file.pp

Released with this license: https://github.com/arioch/puppet-logrotate/blob/master/LICENSE

Released under the terms of Apache 2 License.

This module requires the presence of Example42 Puppi module in your modulepath.

USAGE - Module specific

This module provides different options on how to manage logrotate configuration files.

You can configure the main configuration file with the source or template parameters

You can configure the single logrotate configuration snippets in several ways:

  • You can populate the whole logrotate.d with the source_dir parameter

  • You can create a single configuration snippet with these alternative defines:

    • logrotate::rule - Create snippets based of a lot parameters for each option

    • logrotate::conf - Create snippets based of a configurable template and the provided options

    • logrotate::file - Provide directly a custom file from the source you want

Refer to the documentation in the single defines for details on the option's usage.

All the methods are alternative but can cohexist, it's up to you to use the alternative that better fits your needs.

USAGE - Basic management

  • Install logrotate with default settings

      class { 'logrotate': }
    
  • Install a specific version of logrotate package

      class { 'logrotate':
        version => '1.0.1',
      }
    
  • Remove logrotate resources (it automatically removes also the files provided by the logrotate::rule logrotate::conf and logrotate::file defines

      class { 'logrotate':
        absent => true
      }
    
  • Enable auditing without without making changes on existing logrotate configuration files

      class { 'logrotate':
        audit_only => true
      }
    
  • Module dry-run: Do not make any change on all the resources provided by the module. It applies also to logrotate::rule logrotate::conf and logrotate::file defines

      class { 'logrotate':
        noops => true
      }
    

USAGE - Overrides and Customizations

  • Use custom sources for main config file

      class { 'logrotate':
        source => [ "puppet:///modules/example42/logrotate/logrotate.conf-${hostname}" , "puppet:///modules/example42/logrotate/logrotate.conf" ], 
      }
    
  • Use custom source directory for the whole configuration dir

      class { 'logrotate':
        source_dir       => 'puppet:///modules/example42/logrotate/conf/',
        source_dir_purge => false, # Set to true to purge any existing file not present in $source_dir
      }
    
  • Use custom template for main config file. Note that template and source arguments are alternative.

      class { 'logrotate':
        template => 'example42/logrotate/logrotate.conf.erb',
      }
    
  • Automatically include a custom subclass

      class { 'logrotate':
        my_class => 'example42::my_logrotate',
      }
    

Build Status