mirror of
https://github.com/saltstack-formulas/cron-formula.git
synced 2025-02-19 19:28:44 +01:00
refactor(jinja): used shortened form of |default
filter
This commit is contained in:
parent
951a95980a
commit
a0f891e012
@ -9,11 +9,11 @@
|
||||
{%- for task, task_options in cron.tasks.items() %}
|
||||
|
||||
cron.{{ task }}:
|
||||
cron.{{ task_options.type|default('present') }}:
|
||||
cron.{{ task_options.type|d('present') }}:
|
||||
- name: {{ task_options.name }}
|
||||
- identifier: '{{ task }}'
|
||||
{%- if 'user' in task_options %}
|
||||
- user: {{ task_options.user|default('root') }}
|
||||
- user: {{ task_options.user|d('root') }}
|
||||
{%- endif %}
|
||||
{%- for section in ['minute', 'hour', 'daymonth', 'month', 'dayweek', 'comment', 'special'] %}
|
||||
{%- if section in task_options %}
|
||||
|
@ -10,7 +10,7 @@
|
||||
validate_cron.{{ task }}_absent:
|
||||
module_and_function: cron.get_entry
|
||||
args:
|
||||
- {{ task_options.user|default('root') }}
|
||||
- {{ task_options.user|d('root') }}
|
||||
- {{ task }}
|
||||
assertion: assertFalse
|
||||
|
||||
@ -18,7 +18,7 @@ validate_cron.{{ task }}_absent:
|
||||
validate_cron.{{ task }}_exists:
|
||||
module_and_function: cron.get_entry
|
||||
args:
|
||||
- {{ task_options.user|default('root') }}
|
||||
- {{ task_options.user|d('root') }}
|
||||
- {{ task }}
|
||||
assertion: assertEqual
|
||||
assertion_section: identifier
|
||||
@ -30,7 +30,7 @@ validate_cron.{{ task }}_exists:
|
||||
validate_cron.{{ task }}_{{ section }}:
|
||||
module_and_function: cron.get_entry
|
||||
args:
|
||||
- {{ task_options.user|default('root') }}
|
||||
- {{ task_options.user|d('root') }}
|
||||
- {{ task }}
|
||||
assertion: assertEqual
|
||||
assertion_section: {{ section }}
|
||||
@ -42,7 +42,7 @@ validate_cron.{{ task }}_{{ section }}:
|
||||
validate_cron.{{ task }}_commented:
|
||||
module_and_function: cron.get_entry
|
||||
args:
|
||||
- {{ task_options.user|default('root') }}
|
||||
- {{ task_options.user|d('root') }}
|
||||
- {{ task }}
|
||||
assertion: assertTrue
|
||||
assertion_section: commented
|
||||
|
Loading…
Reference in New Issue
Block a user