1
0
Fork 0
mirror of synced 2024-06-16 05:51:10 -04:00

Pillar configuration structure change to allow file paths with globs

This commit is contained in:
Michal Galet 2015-04-02 21:04:07 +02:00
parent 73c86743e2
commit d94c227d4d
2 changed files with 16 additions and 14 deletions

View file

@ -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 -%}

View file

@ -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