Install logrotate on a host and optionally add logrotate configuration files
Find a file
2018-03-19 16:11:57 +01:00
meta Initial version 2018-01-13 13:39:41 +01:00
tasks Use cache_valid_time for apt module 2018-03-19 16:11:48 +01:00
templates Initial version 2018-01-13 13:39:41 +01:00
History.md prepare release v0.3.0 2018-03-19 16:11:57 +01:00
LICENSE Initial version 2018-01-13 13:39:41 +01:00
README.md Initial version 2018-01-13 13:39:41 +01:00

luzifer-ansible / logrotate

This role installs logrotate on a host and optionally adds logrotate configuration files.

Requirements

  • Debian >= 8 (jessie)
  • Ubuntu >= 16.04 (xenial)

Usage

See the Ansible Galaxy Intro for usage of roles within Ansible Galaxy.

Custom logrotate files are supplied through the logrotate_configs variable:

logrotate_configs:
  - name: vault
    paths:
      - '/var/log/vault/*.log'
    lines:
      - missingok
      - notifempty
      - compress
      - copytruncate
      - daily
      - maxsize 100M
      - rotate 7
    scripts:
      postrotate: ls -lh /var/log/vault  # Just a demonstration, ls makes no sense