set holland backup to minute based on container IP
- modulo 60 the container ip after casting it to an int - use this as the minute for the backup time - set backup hour to 23 - set backup days to all - add full path of holland binary
This commit is contained in:
parent
467f2df926
commit
9401d2dc5b
@ -71,25 +71,15 @@
|
|||||||
- holland_conf
|
- holland_conf
|
||||||
- holland_all
|
- holland_all
|
||||||
|
|
||||||
- name: Check for holland cron file
|
|
||||||
command: ls /etc/cron.d/holland_backups
|
|
||||||
failed_when: false
|
|
||||||
changed_when: holland_cron.rc != 0
|
|
||||||
register: holland_cron
|
|
||||||
tags:
|
|
||||||
- holland_cron
|
|
||||||
- holland_all
|
|
||||||
|
|
||||||
- name: Create holland backup cron job
|
- name: Create holland backup cron job
|
||||||
cron:
|
cron:
|
||||||
name: "holland-backup"
|
name: "holland-backup"
|
||||||
minute: "{{ 59|random }}"
|
minute: "{{ (ansible_eth0['ipv4']['address']|replace('.', '')|int)%60}}"
|
||||||
weekday: "{{ 6|random }}"
|
hour: 23
|
||||||
state: present
|
state: present
|
||||||
job: "holland bk"
|
job: "/usr/local/bin/holland bk"
|
||||||
user: root
|
user: root
|
||||||
cron_file: holland_backups
|
cron_file: holland_backups
|
||||||
when: holland_cron.rc != 0
|
|
||||||
tags:
|
tags:
|
||||||
- holland_cron
|
- holland_cron
|
||||||
- holland_all
|
- holland_all
|
||||||
|
Loading…
x
Reference in New Issue
Block a user