From 7f5a7e48f860441c9d4f7bbe74f146cfbe5e688e Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 26 Aug 2019 11:09:23 -0400 Subject: [PATCH] Add daily Zookeeper data cleanup --- roles/pvc/tasks/zookeeper/main.yml | 6 ++++++ roles/pvc/templates/zookeeper/zookeeper-vacuum.j2 | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 roles/pvc/templates/zookeeper/zookeeper-vacuum.j2 diff --git a/roles/pvc/tasks/zookeeper/main.yml b/roles/pvc/tasks/zookeeper/main.yml index 43eb713..7acc93d 100644 --- a/roles/pvc/tasks/zookeeper/main.yml +++ b/roles/pvc/tasks/zookeeper/main.yml @@ -18,6 +18,12 @@ - zoo.cfg notify: restart zookeeper +- name: install daily vacuum script + template: + src: zookeeper/zookeeper-vacuum.j2 + dest: /etc/cron.daily/zookeeper-vacuum + mode: 0755 + - name: install systemd unit file template: src: zookeeper/zookeeper.service.j2 diff --git a/roles/pvc/templates/zookeeper/zookeeper-vacuum.j2 b/roles/pvc/templates/zookeeper/zookeeper-vacuum.j2 new file mode 100644 index 0000000..5d9859e --- /dev/null +++ b/roles/pvc/templates/zookeeper/zookeeper-vacuum.j2 @@ -0,0 +1,5 @@ +#!/bin/bash +# Daily vaccuum script for PVC Zookeeper cluster +# {{ ansible_managed }} + +/usr/share/zookeeper/bin/zkCleanup.sh /var/lib/zookeeper -n 14