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-03-31 00:06:08 +01:00
|
|
|
cron.{{ task_options.type|default('present') }}:
|
2019-03-31 01:58:35 +01:00
|
|
|
- name: {{ task_options.name }}
|
2019-03-31 00:10:19 +01:00
|
|
|
{%- if 'user' in task_options %}
|
2019-03-31 00:06:08 +01:00
|
|
|
- user: {{ task_options.user|default('root') }}
|
2019-03-31 00:10:19 +01:00
|
|
|
{%- endif %}
|
|
|
|
{%- if 'minute' in task_options %}
|
2019-03-31 00:06:08 +01:00
|
|
|
- minute: '{{ task_options.minute }}'
|
2019-03-31 00:10:19 +01:00
|
|
|
{%- endif %}
|
|
|
|
{%- if 'hour' in task_options %}
|
2019-03-31 00:06:08 +01:00
|
|
|
- hour: '{{ task_options.hour }}'
|
2019-03-31 00:10:19 +01:00
|
|
|
{%- endif %}
|
|
|
|
{%- if 'daymonth' in task_options %}
|
2019-03-31 00:06:08 +01:00
|
|
|
- daymonth: '{{ task_options.daymonth }}'
|
2019-03-31 00:10:19 +01:00
|
|
|
{%- endif %}
|
|
|
|
{%- if 'month' in task_options %}
|
2019-03-31 00:06:08 +01:00
|
|
|
- month: '{{ task_options.month }}'
|
2019-03-31 00:10:19 +01:00
|
|
|
{%- endif %}
|
|
|
|
{%- if 'dayweek' in task_options %}
|
2019-03-31 00:06:08 +01:00
|
|
|
- dayweek: '{{ task_options.dayweek }}'
|
2019-03-31 00:10:19 +01:00
|
|
|
{%- endif %}
|
|
|
|
{%- 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 %}
|
|
|
|
{%- if 'special' in task_options %}
|
2019-03-31 00:06:08 +01:00
|
|
|
- special: '{{ task_options.special }}'
|
2019-03-31 00:10:19 +01:00
|
|
|
{%- endif %}
|
2019-03-31 00:06:08 +01:00
|
|
|
- identifier: '{{ task }}'
|
2019-03-31 00:10:19 +01:00
|
|
|
{%- if 'comment' in task_options %}
|
2019-03-31 01:58:35 +01:00
|
|
|
- comment: {{ task_options.comment }}
|
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 %}
|