Giter VIP home page Giter VIP logo

ansible-role-logrotate's Introduction

#######################################################################################################

❗ DEPRECATION ❗

This repository and the role associated are deprecated in favor of the Manala Ansible Collection

You will find informations on its usage on the collection repository

#######################################################################################################

Ansible Role: Logrotate Build Status

Report issues and send Pull Requests in the main Ansible Role repository

This role will assume the setup of Logrotate.

It's part of the Manala Ansible stack but can be used as a stand alone component.

Requirements

None.

Dependencies

None.

Installation

Ansible 2+

Using ansible galaxy cli:

ansible-galaxy install manala.logrotate

Using ansible galaxy requirements file:

- src: manala.logrotate

Role Handlers

None

Role Variables

Name Default Type Description
manala_logrotate_install_packages ~ Array Dependency packages to install
manala_logrotate_install_packages_default ['logrotate'] Array Default dependency packages to install
manala_logrotate_configs_exclusive false Boolean Exclusion of existing files Configurations
manala_logrotate_configs_dir '/etc/logrotate.d' String Configurations directory path
manala_logrotate_configs_defaults {} Array Configurations defaults
manala_logrotate_configs [] Array Configurations directives

Configurations examples

manala_logrotate_configs:
  # Config based
  - file: config
    config:
      /var/log/nginx/example/*.log:
        size: 200M
        missingok: true
        rotate: 0
  # Dicts array config based (deprecated)
  - file: config_deprecated.conf
    config:
      - /var/log/nginx/example/*.log:
        - size: 200M
        - missingok
        - rotate: 0
        - compress
        - delaycompress
        - notifempty
        - create: 0640 www-data adm
        - sharedscripts
  # Content based
  - file: content
    config: |
      /var/log/nginx/example/*/*.log
      /var/log/nginx/example/*/*/*.log {
          size 200M
          missingok
          rotate 0
          compress
          delaycompress
          notifempty
          create 0640 www-data adm
          sharedscripts
      }
  # Template based (file name based on template)
  - template: telegraf/bar.j2
    config:
      foo: bar
  # Template based (force file name)
  - file: baz
    template: telegraf/bar.j2
    config:
      foo: bar
  # Ensure config is absent
  - file: absent
    state: absent # "present" by default
  # Ignore config
  - file: ignore
    state: ignore
  # Flatten configs
  - "{{ my_custom_configs_array }}"

manala_logrotate_configs_exclusive allow you to clean up existing logrotate configuration files into directory defined by the manala_logrotate_configs_dir key. Made to be sure no old or manually created files will alter current configuration.

manala_logrotate_configs_exclusive: true

Example playbook

- hosts: servers
  roles:
    - role: manala.logrotate

Licence

MIT

Author information

Manala (http://www.manala.io/)

ansible-role-logrotate's People

Contributors

greedybro avatar nervo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  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.