Преглед на файлове

Use cron job identifier to be able to update command

Change-Id: Id571945585863a08bd2317b57ecc6123a16e1857
pull/117/head
Filip Pytloun преди 7 години
родител
ревизия
912222253f
променени са 2 файла, в които са добавени 10 реда и са изтрити 0 реда
  1. +4
    -0
      README.rst
  2. +6
    -0
      linux/system/job.sls

+ 4
- 0
README.rst Целия файл

@@ -234,6 +234,9 @@ Linux with autoupdates (automatically install security package updates)
automatic_reboot_time: "02:00"

Linux with cron jobs
By default it will use name as an identifier, unless identifier key is
explicitly set or False (then it will use Salt's default behavior which is
identifier same as command resulting in not being able to change it)

.. code-block:: yaml

@@ -243,6 +246,7 @@ Linux with cron jobs
job:
cmd1:
command: '/cmd/to/run'
identifier: cmd1
enabled: true
user: 'root'
hour: 2

+ 6
- 0
linux/system/job.sls Целия файл

@@ -7,6 +7,9 @@ linux_job_{{ job.command }}:
{%- if job.enabled|default(True) %}
cron.present:
- name: {{ job.command }}
{%- if job.get('identifier', True) %}
- identifier: {{ job.get('identifier', job.get('name', name)) }}
{%- endif %}
- user: {{ job.user|default("root") }}
{%- if job.minute is defined %}
- minute: '{{ job.minute }}'
@@ -30,6 +33,9 @@ linux_job_{{ job.command }}:
{%- else %}
cron.absent:
- name: {{ job.command }}
{%- if job.get('identifier', True) %}
- identifier: {{ job.get('identifier', job.get('name', name)) }}
{%- endif %}
{%- endif %}

{%- endfor %}

Loading…
Отказ
Запис