Saltstack Official Linux Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
788B

  1. {%- from "linux/map.jinja" import system with context %}
  2. {%- if system.enabled %}
  3. {%- for name, job in system.job.iteritems() %}
  4. linux_job_{{ job.command }}:
  5. {%- if job.enabled %}
  6. cron.present:
  7. - name: {{ job.command }}
  8. - user: {{ job.user }}
  9. {%- if job.minute is defined %}
  10. - minute: '{{ job.minute }}'
  11. {%- endif %}
  12. {%- if job.hour is defined %}
  13. - hour: '{{ job.hour }}'
  14. {%- endif %}
  15. {%- if job.daymonth is defined %}
  16. - daymonth: '{{ job.daymonth }}'
  17. {%- endif %}
  18. {%- if job.month is defined %}
  19. - month: '{{ job.month }}'
  20. {%- endif %}
  21. {%- if job.dayweek is defined %}
  22. - dayweek: '{{ job.dayweek }}'
  23. {%- endif %}
  24. {%- else %}
  25. job.absent:
  26. - name: {{ job.command }}
  27. {%- endif %}
  28. {%- endfor %}
  29. {%- endif %}