Saltstack Official Logrotate Formula
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

34 rindas
1.0KB

  1. # vim: sts=2 ts=2 sw=2 et ai
  2. {% from "logrotate/map.jinja" import logrotate with context %}
  3. include:
  4. - logrotate
  5. logrotate_directory:
  6. file.directory:
  7. - name: {{ logrotate.include_dir }}
  8. - user: {{ salt['pillar.get']('logrotate:config:user', logrotate.user) }}
  9. - group: {{ salt['pillar.get']('logrotate:config:group', logrotate.group) }}
  10. - mode: 755
  11. - makedirs: True
  12. - require:
  13. - pkg: logrotate
  14. {% for key,value in logrotate.jobs.iteritems() %}
  15. {{key}}:
  16. file.managed:
  17. - name: {{ logrotate.include_dir }}/{{ key.split("/")[-1] }}
  18. - source: salt://logrotate/templates/job.tmpl
  19. - template: jinja
  20. - user: {{ salt['pillar.get']('logrotate:config:user', logrotate.user) }}
  21. - group: {{ salt['pillar.get']('logrotate:config:group', logrotate.group) }}
  22. - mode: {{ salt['pillar.get']('logrotate:config:mode', '644') }}
  23. - require:
  24. - pkg: logrotate
  25. - watch_in:
  26. - service: {{ logrotate.service }}
  27. - context:
  28. path: {{ key }}
  29. data: {{ value }}
  30. {%- endfor -%}