ansible-role-cron/README.md
2021-06-12 16:04:27 +02:00

1.1 KiB

Cron

All configuration is to be placed inside the cron dict.

# <name>: *jobconfig*
jobs: {}

# defaults for all jobs, see *jobconfig*
defaults:
  user: root
  weekday: '*'
  hour: '*'
  minute: '*'
  special_time: False
  disabled: False
  random_options:
    weekday: "{{ range(6)|list }}"
    hour: "{{ range(1, 22)|list }}"
    minute: "{{ range(5, 50)|list }}"

# Enable metrics for all jobs with node-exporter:
# * cron_job_last_run_seconds
# * cron_job_exit_code
# * cron_job_duration_seconds
# * cron_job_next_run_seconds
# * cron_job_last_success_seconds
# Label "name" is set to the job name (key in jobs dict)
enable_monitoring: True

jobconfig

# user to run job as
user: root

# actual job to run
job: ''

# weekday to run job at
weekday: '*'

# hour to run job at
hour: '*'

# minute to run job at
minute: '*'

# can be False or (mutaly exclusive with weekday/hour/minute) one of 'random_daily' or 'random_weekly'
special_time: False

# options if 'special_time' is not False
random_options:
  weekday: "{{ range(6)|list }}"
  hour: "{{ range(1, 22)|list }}"
  minute: "{{ range(5, 50)|list }}"