Browse Source

Merge pull request #64 from netmanagers/master

fix(conf): add 'monthly' interval
tags/v0.13.2
Imran Iqbal 2 years ago
parent
commit
ad7bbf8a8b
No account linked to committer's email address
3 changed files with 29 additions and 1 deletions
  1. +1
    -1
      logrotate/templates/logrotate.conf.tmpl
  2. +12
    -0
      pillar.example
  3. +16
    -0
      test/integration/default/controls/jobs.rb

+ 1
- 1
logrotate/templates/logrotate.conf.tmpl View File

# See "man logrotate" for details. # See "man logrotate" for details.


# log files rotation period # log files rotation period
{% for period in ['hourly', 'daily', 'weekly', 'yearly'] -%}
{% for period in ['hourly', 'daily', 'weekly', 'monthly', 'yearly'] -%}
{{ set_parameter(period) }} {{ set_parameter(period) }}
{%- endfor %} {%- endfor %}



+ 12
- 0
pillar.example View File

- notifempty - notifempty
- create 640 root adm - create 640 root adm
- sharedscripts - sharedscripts
a_monthly_job:
path:
- /tmp/var/log/a_service/*.log
config:
- monthly
- missingok
- rotate 12
- compress
- delaycompress
- notifempty
- create 640 root adm
- sharedscripts
syslog: syslog:
path: path:
- /var/log/cron - /var/log/cron

+ 16
- 0
test/integration/default/controls/jobs.rb View File

its('content') { should include 'postrotate' } its('content') { should include 'postrotate' }
its('content') { should include 'kill -USR1 $(cat /var/run/nginx_high_traf.pid)' } its('content') { should include 'kill -USR1 $(cat /var/run/nginx_high_traf.pid)' }
end end

describe file('/etc/logrotate.d/a_monthly_job') do
it { should be_file }
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
its('mode') { should cmp '0644' }
its('content') { should include '/var/log/a_service/*.log' }
its('content') { should include 'monthly' }
its('content') { should include 'missingok' }
its('content') { should include 'rotate 12' }
its('content') { should include 'compress' }
its('content') { should include 'delaycompress' }
its('content') { should include 'notifempty' }
its('content') { should include 'create 640 root adm' }
its('content') { should include 'sharedscripts' }
end

Loading…
Cancel
Save