Pillar configuration structure change to allow file paths with globs
This commit is contained in:
parent
73c86743e2
commit
d94c227d4d
2 changed files with 16 additions and 14 deletions
|
@ -5,10 +5,10 @@
|
|||
include:
|
||||
- logrotate
|
||||
|
||||
{% for key,value in jobs.iteritems() %}
|
||||
{{key}}:
|
||||
{% for job_name,value in jobs.iteritems() %}
|
||||
{{ value.path }}:
|
||||
file.managed:
|
||||
- name: {{ logrotate.include_dir }}/{{ key.split("/")[-1] }}
|
||||
- name: {{ logrotate.include_dir }}/{{ job_name }}
|
||||
- source: salt://logrotate/templates/job.tmpl
|
||||
- template: jinja
|
||||
- user: {{ salt['pillar.get']('logrotate:config:user', logrotate.user) }}
|
||||
|
@ -19,6 +19,6 @@ include:
|
|||
- watch_in:
|
||||
- service: {{ logrotate.service }}
|
||||
- context:
|
||||
path: {{ key }}
|
||||
data: {{ value }}
|
||||
path: {{ value.path }}
|
||||
data: {{ value.data }}
|
||||
{%- endfor -%}
|
||||
|
|
|
@ -4,12 +4,14 @@ logrotate:
|
|||
pkg: logrotate
|
||||
service: crond
|
||||
jobs:
|
||||
/tmp/var/log/mysql/error:
|
||||
- weekly
|
||||
- missingok
|
||||
- rotate 52
|
||||
- compress
|
||||
- delaycompress
|
||||
- notifempty
|
||||
- create 640 root adm
|
||||
- sharedscripts
|
||||
httpd:
|
||||
path: /var/log/httpd/*log
|
||||
data:
|
||||
- weekly
|
||||
- missingok
|
||||
- rotate 52
|
||||
- compress
|
||||
- delaycompress
|
||||
- notifempty
|
||||
- create 640 root adm
|
||||
- sharedscripts
|
||||
|
|
Loading…
Reference in a new issue