Git Product home page Git Product logo

ansible-logrotate's Introduction

Stats

retr0h's GitHub stats

Skill Set ๐Ÿ’ช

retr2h's Top Langs

ansible-logrotate's People

Contributors

retr0h avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ansible-logrotate's Issues

diff support

Great module, but looks like when you run it in check/diff mode, the task is skipped. Adding check and diff support would be a great feature.

need some fixes

This ansible role makes the task easier to define different logrotate configuration for different applications. The idea to make it run as ansible module is better than the other hottest ansible logrotate galaxy role (https://github.com/nickhammond/ansible-logrotate)

But when I implement the vars file, I got two problems, in fact three. Here is my task file.

$ cat roles/common/tasks/logrotate.yml
- name: Define logrotate config
  logrotate: name=syslog path='/var/log/cron /var/log/maillog /var/log/messages /var/log/secure /var/log/spooler'
  args:
    options:
      - compress
      - copytruncate
      - missingok
      - sharedscripts
      - weekly
      - rotate 12
      - postrotate
      - '  /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true'
      - endscript
  tags:
    - logrotate

So I have to:

put path into one line: path='/var/log/cron /var/log/maillog /var/log/messages /var/log/secure /var/log/spooler'

can we have something as:

- name: Define logrotate config
  logrotate: name=syslog 
  path:
     - /var/log/cron 
     - /var/log/maillog 
     - /var/log/messages 
     - /var/log/secure 
     - /var/log/spooler
  args:
    ...

put spaces before exec script.

  - '  /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true'

the { is in new line, as below.

/var/log/cron /var/log/maillog /var/log/messages /var/log/secure /var/log/spooler
{
  compress
  copytruncate
  missingok
  sharedscripts
  weekly
  rotate 12
  postrotate
    /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
  endscript
}

I know it should work, but will be better to update as

/var/log/cron /var/log/maillog /var/log/messages /var/log/secure /var/log/spooler {
  ...
}

Does not work for ansible 2.x

The only change I had to make was to explicitly define the type for 'options':

            options    = dict(type='list',
                              default=['daily',
                                       'missingok',
                                        ...

Old version on galaxy

Recently when downloading this role from galaxy I'm getting an older version. Looks like there might be a problem with the tags. 1.0 and 2.0 are pointing to the same commit. Is this correct?

Using the logrotate module with the version from galaxy creates configuration files with one letter on each line:

# Generated by Ansible.
# Local modifications will be overwritten.

/var/log/*.log {
  [
  '
  d
  a
  i
  l
  y
  '
  ,
   
  '
  m
  i
  s
  s
  i
  n
  g
  o
  k
  '
  ,
   
  '
  r
  o
  t
  a
  t
  e
   
  8
  '
  ,
   
  '
  c
  o
  m
  p
  r
  e
  s
  s
  '
  ,
   
  '
  d
  e
  l
  a
  y
  c
  o
  m
  p
  r
  e
  s
  s
  '
  ,
   
  '
  c
  o
  p
  y
  t
  r
  u
  n
  c
  a
  t
  e
  '
  ,
   
  '
  n
  o
  t
  i
  f
  e
  m
  p
  t
  y
  '
  ]
}

core integration update

Hi,

The readme says: In process of moving this to into core ansible. So this is going to be a built in ansible module? Any idea when it will be integrated?

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.