From a1cf5b3f6f13d9f747cae81f79de51ee71233d8c Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Thu, 16 Sep 2021 14:12:08 -0700 Subject: [PATCH] Run daily backups of nodepool zk image data This does local backups of the nodepool zk image image data to /var/log/nodepool on the nodepool-builders. These hosts don't get offsite backups but we run mutliple redundant servers. This data isn't critical as we can start from scratch, but may be useful if we don't want to go through all that trouble. Change-Id: I7d150df9c0d9566ef2d32167cea535e29822cfa2 --- playbooks/roles/nodepool-builder/tasks/main.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/playbooks/roles/nodepool-builder/tasks/main.yaml b/playbooks/roles/nodepool-builder/tasks/main.yaml index 9bbfa4bacd..ce8ce6edd6 100644 --- a/playbooks/roles/nodepool-builder/tasks/main.yaml +++ b/playbooks/roles/nodepool-builder/tasks/main.yaml @@ -41,3 +41,12 @@ - name: Run docker prune to cleanup unneeded images shell: cmd: docker image prune -f + +- name: Backup nodepool zk image data daily + cron: + name: Backup nodepool zk image data + minute: '{{ 59 | random(seed=inventory_hostname) }}' + hour: '{{ 23 | random(seed=inventory_hostname) }}' + # Note we backup to /var/log/nodepool because that is what we have bind + # mounted in the container and we are operating relative to that context + job: docker exec nodepool-builder-compose_nodepool-builder_1 nodepool export-image-data /var/log/nodepool/nodepool-image-backup.json