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

@@ -6,13 +6,14 @@ include:
- linux.system.cron

{%- 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) %}
cron.present:
- name: >
{{ job.command }}
{{ job_state_name }}
{%- if job.get('identifier', True) %}
- identifier: {{ job.get('identifier', job.get('name', name)) }}
{%- endif %}
@@ -46,7 +47,8 @@ linux_job_{{ job.command }}:
{%- endif %}
{%- else %}
cron.absent:
- name: {{ job.command }}
- name: >
{{ job_state_name }}
{%- if job.get('identifier', True) %}
- identifier: {{ job.get('identifier', job.get('name', name)) }}
{%- endif %}

Loading…
Cancel
Save