system-config/playbooks/roles/reprepro/tasks/utils/cron.yaml
Ian Wienand 3ddbba92ae reprepro: fix cron config path and randomise times better
The config should use the full path to the config directory, append
/etc/reprepro to the job.

Currently all the reprepro jobs hash to the same start time because it
uses the hostname as a seed.  Use the unique string name as the seed
so each job starts at a unique time.

Change-Id: If2745d0cd274f390dbff6337b7a44093b5919908
2020-10-29 09:27:29 +11:00

8 lines
336 B
YAML

- name: Install update cron jobs
cron:
name: '{{ _string_name }} reprepro mirror sync'
state: present
job: 'flock -n /var/run/reprepro/{{ _dir }}.lock reprepro-mirror-update /etc/reprepro/{{ _dir }} {{ _volume }} >> /var/log/reprepro/{{ _dir }}.log 2>&1'
hour: '*/2'
minute: '{{ 45 | random(seed=_string_name) }}'