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:
|
include:
|
||||||
- logrotate
|
- logrotate
|
||||||
|
|
||||||
{% for key,value in jobs.iteritems() %}
|
{% for job_name,value in jobs.iteritems() %}
|
||||||
{{key}}:
|
{{ value.path }}:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: {{ logrotate.include_dir }}/{{ key.split("/")[-1] }}
|
- name: {{ logrotate.include_dir }}/{{ job_name }}
|
||||||
- source: salt://logrotate/templates/job.tmpl
|
- source: salt://logrotate/templates/job.tmpl
|
||||||
- template: jinja
|
- template: jinja
|
||||||
- user: {{ salt['pillar.get']('logrotate:config:user', logrotate.user) }}
|
- user: {{ salt['pillar.get']('logrotate:config:user', logrotate.user) }}
|
||||||
|
@ -19,6 +19,6 @@ include:
|
||||||
- watch_in:
|
- watch_in:
|
||||||
- service: {{ logrotate.service }}
|
- service: {{ logrotate.service }}
|
||||||
- context:
|
- context:
|
||||||
path: {{ key }}
|
path: {{ value.path }}
|
||||||
data: {{ value }}
|
data: {{ value.data }}
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
|
|
|
@ -4,7 +4,9 @@ logrotate:
|
||||||
pkg: logrotate
|
pkg: logrotate
|
||||||
service: crond
|
service: crond
|
||||||
jobs:
|
jobs:
|
||||||
/tmp/var/log/mysql/error:
|
httpd:
|
||||||
|
path: /var/log/httpd/*log
|
||||||
|
data:
|
||||||
- weekly
|
- weekly
|
||||||
- missingok
|
- missingok
|
||||||
- rotate 52
|
- rotate 52
|
||||||
|
|
Loading…
Reference in a new issue