commit
d6ce3cd1bc
3 changed files with 29 additions and 12 deletions
|
@ -6,7 +6,7 @@ include:
|
||||||
- logrotate
|
- logrotate
|
||||||
|
|
||||||
{% for key,value in jobs.iteritems() %}
|
{% for key,value in jobs.iteritems() %}
|
||||||
{{key}}:
|
logrotate_{{key}}:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: {{ logrotate.include_dir }}/{{ key.split("/")[-1] }}
|
- name: {{ logrotate.include_dir }}/{{ key.split("/")[-1] }}
|
||||||
- source: salt://logrotate/templates/job.tmpl
|
- source: salt://logrotate/templates/job.tmpl
|
||||||
|
@ -19,6 +19,11 @@ include:
|
||||||
- watch_in:
|
- watch_in:
|
||||||
- service: {{ logrotate.service }}
|
- service: {{ logrotate.service }}
|
||||||
- context:
|
- context:
|
||||||
|
{% if value is mapping %}
|
||||||
|
path: {{ value.get('path', key) }}
|
||||||
|
data: {{ value.get('config', []) }}
|
||||||
|
{% else %}
|
||||||
path: {{ key }}
|
path: {{ key }}
|
||||||
data: {{ value }}
|
data: {{ value }}
|
||||||
|
{% endif %}
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
|
|
|
@ -4,12 +4,24 @@ logrotate:
|
||||||
pkg: logrotate
|
pkg: logrotate
|
||||||
service: crond
|
service: crond
|
||||||
jobs:
|
jobs:
|
||||||
/tmp/var/log/mysql/error:
|
/tmp/var/log/mysql/error:
|
||||||
- weekly
|
config:
|
||||||
- missingok
|
- weekly
|
||||||
- rotate 52
|
- missingok
|
||||||
- compress
|
- rotate 52
|
||||||
- delaycompress
|
- compress
|
||||||
- notifempty
|
- delaycompress
|
||||||
- create 640 root adm
|
- notifempty
|
||||||
- sharedscripts
|
- create 640 root adm
|
||||||
|
- sharedscripts
|
||||||
|
mysql:
|
||||||
|
path: /tmp/var/log/mysql/*.log
|
||||||
|
config:
|
||||||
|
- weekly
|
||||||
|
- missingok
|
||||||
|
- rotate 52
|
||||||
|
- compress
|
||||||
|
- delaycompress
|
||||||
|
- notifempty
|
||||||
|
- create 640 root adm
|
||||||
|
- sharedscripts
|
||||||
|
|
Loading…
Reference in a new issue