diff --git a/cron/config.sls b/cron/config.sls index 73954d6..55748eb 100644 --- a/cron/config.sls +++ b/cron/config.sls @@ -8,7 +8,7 @@ cron.{{ task }}: cron.{{ task_options.type|default('present') }}: - - name: '{{ task_options.name }}' + - name: {{ task_options.name }} {%- if 'user' in task_options %} - user: {{ task_options.user|default('root') }} {%- endif %} @@ -35,7 +35,7 @@ cron.{{ task }}: {%- endif %} - identifier: '{{ task }}' {%- if 'comment' in task_options %} - - comment: '{{ task_options.comment }}' + - comment: {{ task_options.comment }} {%- endif %} {%- endfor %} {%- endif %} diff --git a/pillar.example b/pillar.example index 44eb0cd..ab93d14 100644 --- a/pillar.example +++ b/pillar.example @@ -1,34 +1,34 @@ cron: - enabled: True # Default - lookup: # Not needed, just if you want to use another cron program - pkg: 'cronie' + enabled: True # Default + lookup: # Not needed, just if you want to use another cron program + pkg: cronie tasks: task1: - type: 'present' # Default - name: 'echo test > /tmp/test' - user: 'root' + type: present # Default + name: echo test > /tmp/test + user: root minute: 0 hour: 0 daymonth: 7 month: 1 dayweek: 6 - comment: 'comment1' + comment: comment1 task2: - type: 'absent' # To remove that crontask - name: 'echo task2 > /tmp/test2' - user: 'root' - minute: 'random' + type: absent # To remove that crontask + name: echo task2 > /tmp/test2 + user: root + minute: random hour: 1 task3: - type: 'absent' - name: 'echo task3 > /tmp/test3' - user: 'root' + type: absent + name: echo task3 > /tmp/test3 + user: root special: '@hourly' - comment: 'comment3' + comment: comment3 task4: - type: 'present' # run every 5 minutes - name: 'echo task4 > /tmp/test4' - user: 'root' + type: present # run every 5 minutes + name: echo task4 > /tmp/test4 + user: root minute: '*/5' hour: '*' - comment: 'comment4' + comment: comment4