0
0
mirror of https://github.com/saltstack-formulas/cron-formula.git synced 2024-11-28 03:27:50 +01:00

fix(quotes): remove single quotes causing issues (or unnecessary)

* Allow single quotes to be used in commands and comments, e.g.:
  - /usr/bin/salt '*' test.ping >/root/salt_test_ping
This commit is contained in:
Imran Iqbal 2019-03-31 00:58:35 +00:00
parent 01a858a23e
commit 8ee7ffa282
No known key found for this signature in database
GPG Key ID: 6D8629439D2B7819
2 changed files with 21 additions and 21 deletions

View File

@ -8,7 +8,7 @@
cron.{{ task }}: cron.{{ task }}:
cron.{{ task_options.type|default('present') }}: cron.{{ task_options.type|default('present') }}:
- name: '{{ task_options.name }}' - name: {{ task_options.name }}
{%- if 'user' in task_options %} {%- if 'user' in task_options %}
- user: {{ task_options.user|default('root') }} - user: {{ task_options.user|default('root') }}
{%- endif %} {%- endif %}
@ -35,7 +35,7 @@ cron.{{ task }}:
{%- endif %} {%- endif %}
- identifier: '{{ task }}' - identifier: '{{ task }}'
{%- if 'comment' in task_options %} {%- if 'comment' in task_options %}
- comment: '{{ task_options.comment }}' - comment: {{ task_options.comment }}
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}
{%- endif %} {%- endif %}

View File

@ -1,34 +1,34 @@
cron: cron:
enabled: True # Default enabled: True # Default
lookup: # Not needed, just if you want to use another cron program lookup: # Not needed, just if you want to use another cron program
pkg: 'cronie' pkg: cronie
tasks: tasks:
task1: task1:
type: 'present' # Default type: present # Default
name: 'echo test > /tmp/test' name: echo test > /tmp/test
user: 'root' user: root
minute: 0 minute: 0
hour: 0 hour: 0
daymonth: 7 daymonth: 7
month: 1 month: 1
dayweek: 6 dayweek: 6
comment: 'comment1' comment: comment1
task2: task2:
type: 'absent' # To remove that crontask type: absent # To remove that crontask
name: 'echo task2 > /tmp/test2' name: echo task2 > /tmp/test2
user: 'root' user: root
minute: 'random' minute: random
hour: 1 hour: 1
task3: task3:
type: 'absent' type: absent
name: 'echo task3 > /tmp/test3' name: echo task3 > /tmp/test3
user: 'root' user: root
special: '@hourly' special: '@hourly'
comment: 'comment3' comment: comment3
task4: task4:
type: 'present' # run every 5 minutes type: present # run every 5 minutes
name: 'echo task4 > /tmp/test4' name: echo task4 > /tmp/test4
user: 'root' user: root
minute: '*/5' minute: '*/5'
hour: '*' hour: '*'
comment: 'comment4' comment: comment4