From 3ddbba92ae4b15a3c615e62964d6a37aa7b9fb37 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Thu, 29 Oct 2020 09:09:28 +1100 Subject: [PATCH] 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 --- playbooks/roles/reprepro/tasks/utils/cron.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/roles/reprepro/tasks/utils/cron.yaml b/playbooks/roles/reprepro/tasks/utils/cron.yaml index 2a33be6c1e..963d5cf664 100644 --- a/playbooks/roles/reprepro/tasks/utils/cron.yaml +++ b/playbooks/roles/reprepro/tasks/utils/cron.yaml @@ -2,6 +2,6 @@ cron: name: '{{ _string_name }} reprepro mirror sync' state: present - job: 'flock -n /var/run/reprepro/{{ _dir }}.lock reprepro-mirror-update {{ _dir }} {{ _volume }} >> /var/log/reprepro/{{ _dir }}.log 2>&1' + 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=inventory_hostname) }}' + minute: '{{ 45 | random(seed=_string_name) }}'