1
0
Fork 0
mirror of synced 2024-11-03 00:58:59 -04:00
formula-logrotate/logrotate/jobs.sls
Wolodja Wentland 624700a372 Use items() in lieu of iteritems()
The iteritems dictionary method has been removed in Python 3 and using
items() is typically no problem in our case due to the fact that
dictionaries are rather small.

This fixes #15
2015-10-12 17:22:12 +02:00

29 lines
932 B
Text

# vim: sts=2 ts=2 sw=2 et ai
{% from "logrotate/map.jinja" import logrotate with context %}
{% set jobs = salt['pillar.get']('logrotate:jobs', {}) %}
include:
- logrotate
{% for key,value in jobs.items() %}
logrotate_{{key}}:
file.managed:
- name: {{ logrotate.include_dir }}/{{ key.split("/")[-1] }}
- source: salt://logrotate/templates/job.tmpl
- template: jinja
- user: {{ salt['pillar.get']('logrotate:config:user', logrotate.user) }}
- group: {{ salt['pillar.get']('logrotate:config:group', logrotate.group) }}
- mode: {{ salt['pillar.get']('logrotate:config:mode', '644') }}
- require:
- pkg: logrotate
- watch_in:
- service: {{ logrotate.service }}
- context:
{% if value is mapping %}
path: {{ value.get('path', key) }}
data: {{ value.get('config', []) }}
{% else %}
path: {{ key }}
data: {{ value }}
{% endif %}
{%- endfor -%}