2017-07-28 01:43:45 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=sls
|
|
|
|
|
2019-08-28 00:21:22 +02:00
|
|
|
{#- Get the `tplroot` from `tpldir` #}
|
|
|
|
{%- set tplroot = tpldir.split('/')[0] %}
|
|
|
|
{%- from tplroot ~ "/map.jinja" import cron with context %}
|
2017-07-28 01:43:45 +02:00
|
|
|
|
2019-08-28 00:21:22 +02:00
|
|
|
{%- if 'tasks' in cron %}
|
2019-10-14 16:45:27 +02:00
|
|
|
{%- for task, task_options in cron.tasks.items() %}
|
2017-07-28 01:43:45 +02:00
|
|
|
|
|
|
|
cron.{{ task }}:
|
2019-10-17 20:27:23 +02:00
|
|
|
cron.{{ task_options.type|d('present') }}:
|
2019-03-31 01:58:35 +01:00
|
|
|
- name: {{ task_options.name }}
|
2019-10-15 22:58:55 +02:00
|
|
|
- identifier: '{{ task }}'
|
2019-03-31 00:10:19 +01:00
|
|
|
{%- if 'user' in task_options %}
|
2019-10-17 20:27:23 +02:00
|
|
|
- user: {{ task_options.user|d('root') }}
|
2019-03-31 00:10:19 +01:00
|
|
|
{%- endif %}
|
2019-10-15 22:58:55 +02:00
|
|
|
{%- for section in ['minute', 'hour', 'daymonth', 'month', 'dayweek', 'comment', 'special'] %}
|
|
|
|
{%- if section in task_options %}
|
|
|
|
- {{ section }}: '{{ task_options.get(section) }}'
|
|
|
|
{%- endif %}
|
|
|
|
{%- endfor %}
|
2019-03-31 00:10:19 +01:00
|
|
|
{%- if 'commented' in task_options and task_options.commented %}
|
2019-03-31 00:06:08 +01:00
|
|
|
- commented: True
|
2019-03-31 00:10:19 +01:00
|
|
|
{%- endif %}
|
2019-08-28 00:21:22 +02:00
|
|
|
{%- endfor %}
|
2019-03-31 00:10:19 +01:00
|
|
|
{%- endif %}
|