Browse Source

Require less options for linux.system.job

Change-Id: I74f63a705de8abef146cd1a77f8563e5de5d7f8d
pull/117/head
Filip Pytloun 7 years ago
parent
commit
3a761a133f
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      linux/system/job.sls

+ 4
- 4
linux/system/job.sls View File

{%- for name, job in system.job.iteritems() %} {%- for name, job in system.job.iteritems() %}


linux_job_{{ job.command }}: linux_job_{{ job.command }}:
{%- if job.enabled %}
{%- if job.enabled|default(True) %}
cron.present: cron.present:
- name: {{ job.command }} - name: {{ job.command }}
- user: {{ job.user }}
- user: {{ job.user|default("root") }}
{%- if job.minute is defined %} {%- if job.minute is defined %}
- minute: '{{ job.minute }}' - minute: '{{ job.minute }}'
{%- endif %} {%- endif %}
{%- if job.dayweek is defined %} {%- if job.dayweek is defined %}
- dayweek: '{{ job.dayweek }}' - dayweek: '{{ job.dayweek }}'
{%- endif %} {%- endif %}
{%- if job.user in system.get('user', {}).keys() %}
{%- if job.user|default("root") in system.get('user', {}).keys() %}
- require: - require:
- user: system_user_{{ job.user }}
- user: system_user_{{ job.user|default("root") }}
{%- endif %} {%- endif %}
{%- else %} {%- else %}
cron.absent: cron.absent:

Loading…
Cancel
Save