Use inventory_hostname as random seed to keep same Cron time. By @stroobl (#54)

This commit is contained in:
Luc Stroobant 2021-01-12 02:58:47 +01:00 committed by GitHub
parent e9caa74560
commit 9193c18128
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 7 deletions

View File

@ -37,8 +37,8 @@ bb_quota_size: 0
bb_alertdays: 0 bb_alertdays: 0
bb_repo_name: "{{ inventory_hostname }}" bb_repo_name: "{{ inventory_hostname }}"
bb_sshkey: "{{ root_user['ssh_public_key'] }}" bb_sshkey: "{{ root_user['ssh_public_key'] }}"
borgmatic_cron_hour: "{{ 6 | random }}" borgmatic_cron_hour: "{{ 6 | random(seed=inventory_hostname) }}"
borgmatic_cron_minute: "{{ 59 | random }}" borgmatic_cron_minute: "{{ 59 | random(seed=inventory_hostname) }}"
borgmatic_cron_checks_day: "{{ range(1, 28) | random }}" borgmatic_cron_checks_day: "{{ range(1, 28) | random(seed=inventory_hostname) }}"
borgmatic_cron_checks_hour: "{{ range(7, 24) | random }}" borgmatic_cron_checks_hour: "{{ range(7, 24) | random(seed=inventory_hostname) }}"
borgmatic_cron_checks_minute: "{{ 59 | random }}" borgmatic_cron_checks_minute: "{{ 59 | random(seed=inventory_hostname) }}"

View File

@ -84,7 +84,6 @@
mode: 0600 mode: 0600
- name: Add cron-job for borgmatic (large repo, create and check separate) - name: Add cron-job for borgmatic (large repo, create and check separate)
tags: molecule-idempotence-notest
block: block:
- name: Add cron job for regular create and prune - name: Add cron job for regular create and prune
cron: cron:
@ -106,7 +105,6 @@
when: borgmatic_large_repo when: borgmatic_large_repo
- name: Add cron-job for borgmatic (normal-sized repo) - name: Add cron-job for borgmatic (normal-sized repo)
tags: molecule-idempotence-notest
block: block:
- name: Add cron job for create, check and prune - name: Add cron job for create, check and prune
cron: cron: