From 94ef3490ab1bf41cf0e68ca1a86597c25031808d Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 1 Sep 2023 15:42:21 -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