Browse Source

Update jobs to use the identifier scheme described in documentation

Job identifiers currently ignore both `identifier` and `name`.  If you
have two jobs defined that have the same `command`, the formula
currently blows up.
pull/237/head
Kat Rossiter 1 month ago
parent
commit
34202c3cb9
Failed to extract signature
1 changed files with 6 additions and 4 deletions
  1. +6
    -4
      linux/system/job.sls

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

- linux.system.cron - linux.system.cron


{%- for name, job in system.job.items() %} {%- for name, job in system.job.items() %}
{%- set job_user = job.get('user', 'root') %}
{%- set job_user = job.get('user', 'root') %}
{%- set job_state_name = job.get('identifier', job.command) %}


linux_job_{{ job.command }}:
linux_job_{{ name }}:
{%- if job.get('enabled', True) %} {%- if job.get('enabled', True) %}
cron.present: cron.present:
- name: > - name: >
{{ job.command }}
{{ job_state_name }}
{%- if job.get('identifier', True) %} {%- if job.get('identifier', True) %}
- identifier: {{ job.get('identifier', job.get('name', name)) }} - identifier: {{ job.get('identifier', job.get('name', name)) }}
{%- endif %} {%- endif %}
{%- endif %} {%- endif %}
{%- else %} {%- else %}
cron.absent: cron.absent:
- name: {{ job.command }}
- name: >
{{ job_state_name }}
{%- if job.get('identifier', True) %} {%- if job.get('identifier', True) %}
- identifier: {{ job.get('identifier', job.get('name', name)) }} - identifier: {{ job.get('identifier', job.get('name', name)) }}
{%- endif %} {%- endif %}

Loading…
Cancel
Save