diff --git a/playbooks/roles/borg-backup/tasks/main.yaml b/playbooks/roles/borg-backup/tasks/main.yaml index 88e65e0a1c..c28f693739 100644 --- a/playbooks/roles/borg-backup/tasks/main.yaml +++ b/playbooks/roles/borg-backup/tasks/main.yaml @@ -58,9 +58,13 @@ name: "Run borg backup to {{ item }}" job: "/usr/local/bin/borg-backup {{ item }} 2>> /var/log/borg-backup-{{ item }}.log" user: root - hour: '5' + # 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) }}' with_inventory_hostnames: borg-backup-server + loop_control: + extended: yes - name: Install logrotate rules include_role: