Giter VIP home page Giter VIP logo

ansible-logrotated's Introduction

logrotated

Build Status Ansible Galaxy

Manage logrotated.d in Debian-like systems.

Requirements

None

Variables

  • logrotated_logrotate_d_files [default: {}]: /etc/logrotated.d/* A list of application-specific file declarations
  • logrotated_logrotate_d_files.key: The name of the logrotated configuration file (e.g apache2)
  • logrotated_logrotate_d_files.key.{n} [optional, default: []]: A section declaration
  • logrotated_logrotate_d_files.key.{n}.logs [default: []]: The log files for this section
  • logrotated_logrotate_d_files.key.{n}.size [optional]: Rotate logs when they reach this size
  • logrotated_logrotate_d_files.key.{n}.daily [optional]: Whether or not log files are rotated every day
  • logrotated_logrotate_d_files.key.{n}.weekly [optional]: Whether or not log files are rotated weekly
  • logrotated_logrotate_d_files.key.{n}.monthly [optional]: Whether or not log files are rotated monthly
  • logrotated_logrotate_d_files.key.{n}.yearly [optional]: Whether or not log files are rotated yearly
  • logrotated_logrotate_d_files.key.{n}.missingok [optional]: Whether or not to go on to the next log file without issuing an error message when the log file is missing
  • logrotated_logrotate_d_files.key.{n}.rotate [optional]: Number of times log files are rotated (before being removed)
  • logrotated_logrotate_d_files.key.{n}.compress [optional]: Whether or not old versions of log files are compressed
  • logrotated_logrotate_d_files.key.{n}.delaycompress [optional]: Whether or not to postpone compression of the previous log file to the next rotation cycle
  • logrotated_logrotate_d_files.key.{n}.copytruncate [optional]: Whether or not to truncate the original log file to zero size in place after creating a copy
  • logrotated_logrotate_d_files.key.{n}.notifempty [optional]: Whether or not to not rotate the log if it is empty
  • logrotated_logrotate_d_files.key.{n}.create [optional]: Whether or not the log file is created immediately after rotation wit the given mode, owner and group
  • logrotated_logrotate_d_files.key.{n}.sharedscripts [optional]: Whether or not the scripts are only run once, no matter how many logs match the wildcarded pattern
  • logrotated_logrotate_d_files.key.{n}.scripts [optional, default: {}]: A hash of scripts
  • logrotated_logrotate_d_files.key.{n}.scripts.key [required]: Action to run the script (e.g postrotate)
  • logrotated_logrotate_d_files.key.{n}.scripts.key.{n} [default: []]: List of lines with directives to execute

Dependencies

None

Example(s)

Simple configuration
---
- hosts: all
  roles:
    - oefenweb.logrotated
Complex configuration
---
- hosts: all
  roles:
    - oefenweb.logrotated
  vars:
    logrotated_logrotate_d_files:
      apache2:
        - logs:
            - '/var/log/apache2/*.log'
          weekly: true
          missingok: true
          rotate: 52
          compress: true
          delaycompress: true
          notifempty: true
          create: '640 root adm'
          sharedscripts: true
          scripts:
            postrotate:
              - 'if /etc/init.d/apache2 status > /dev/null ; then \'
              - '  /etc/init.d/apache2 reload > /dev/null; \'
              - 'fi;'
            prerotate:
              - 'if [ -d /etc/logrotate.d/httpd-prerotate ]; then \'
              - '  run-parts /etc/logrotate.d/httpd-prerotate; \'
              - 'fi;'

License

MIT

Author Information

  • Mark van Driel
  • Mischa ter Smitten

Feedback, bug-reports, requests, ...

Are welcome!

ansible-logrotated's People

Contributors

ecassady avatar mvdriel avatar tersmitten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.