From 9401d2dc5b0dd7dee3b659605373e4bbd45f6df9 Mon Sep 17 00:00:00 2001 From: Darren Birkett Date: Thu, 16 Oct 2014 12:44:30 +0100 Subject: [PATCH] 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 --- .../roles/rpc_support_holland/tasks/holland.yml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/rpc_deployment/roles/rpc_support_holland/tasks/holland.yml b/rpc_deployment/roles/rpc_support_holland/tasks/holland.yml index e7db5ce605..ef88bc0f22 100644 --- a/rpc_deployment/roles/rpc_support_holland/tasks/holland.yml +++ b/rpc_deployment/roles/rpc_support_holland/tasks/holland.yml @@ -71,25 +71,15 @@ - holland_conf - 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 cron: name: "holland-backup" - minute: "{{ 59|random }}" - weekday: "{{ 6|random }}" + minute: "{{ (ansible_eth0['ipv4']['address']|replace('.', '')|int)%60}}" + hour: 23 state: present - job: "holland bk" + job: "/usr/local/bin/holland bk" user: root cron_file: holland_backups - when: holland_cron.rc != 0 tags: - holland_cron - holland_all