From 10007aecde06fcfd6d5af52756d71e909fa70694 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 18 Aug 2021 05:24:57 +1000 Subject: [PATCH] borg-backup: randomise time on a per-server basis Currently this randomises the minute based on a seed generated from the backup server name; i.e. all hosts going to a particular backup server get the same minute. Use the inventory_hostname of the host actually being backed up as the seed; this will distribute the backups over the hour as originally intended. Change-Id: If25587492e057bed765c91ea759af43293775126 --- playbooks/roles/borg-backup/tasks/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/roles/borg-backup/tasks/main.yaml b/playbooks/roles/borg-backup/tasks/main.yaml index 4ccc7f867b..b1ee8a5289 100644 --- a/playbooks/roles/borg-backup/tasks/main.yaml +++ b/playbooks/roles/borg-backup/tasks/main.yaml @@ -67,7 +67,7 @@ # This should space out the backups so they run in a round-robbin # evenly through the day to each of the different backup servers hour: '{{ ((5 + ((24 / ansible_loop.length) * ansible_loop.index0 )) % 24) | int}}' - minute: '{{ 59|random(seed=item) }}' + minute: '{{ 59|random(seed=inventory_hostname) }}' with_inventory_hostnames: borg-backup-server loop_control: extended: yes