Giter Site home page Giter Site logo

berry-nature / ansible-logrotate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nickhammond/ansible-logrotate

0.0 2.0 0.0 24 KB

Ansible Galaxy role to setup logrotate and additional rotation scripts

License: BSD 3-Clause "New" or "Revised" License

ansible-logrotate's Introduction

logrotate

Build Status

Installs logrotate and provides an easy way to setup additional logrotate scripts by specifying a list of directives.

Requirements

None

Role Variables

logrotate_scripts: A list of logrotate scripts and the directives to use for the rotation.

  • name - The name of the script that goes into /etc/logrotate.d/
  • path - Path to point logrotate to for the log rotation
  • options - List of directives for logrotate, view the logrotate man page for specifics
  • scripts - Dict of scripts for logrotate (see Example below)
logrotate_scripts:
  - name: rails
    path: "/srv/current/log/*.log"
    options:
      - weekly
      - size 25M
      - missingok
      - compress
      - delaycompress
      - copytruncate

Dependencies

None

Example Playbook

Setting up logrotate for additional Nginx logs, with postrotate script (assuming this role is located in roles/logrotate).

- role: logrotate
  logrotate_scripts:
    - name: nginx
      path: /var/log/nginx/*.log
      options:
        - weekly
        - size 25M
        - rotate 7
        - missingok
        - compress
        - delaycompress
        - copytruncate
      scripts:
        postrotate: "[ -s /run/nginx.pid ] && kill -USR1 `cat /run/nginx.pid`"

License

BSD

Author Information

ansible-logrotate's People

Contributors

nickhammond avatar bigjust avatar antstorm avatar kagux avatar lchabert avatar zeelax avatar swalkinshaw avatar

Watchers

James Cloos avatar colorfulberry 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.