0
0
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:
Imran Iqbal 2019-10-17 19:27:23 +01:00
parent 951a95980a
commit a0f891e012
No known key found for this signature in database
GPG Key ID: 6D8629439D2B7819
2 changed files with 6 additions and 6 deletions

View File

@ -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 %}

View File

@ -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