Clean up old dogtag backups before creating new
Related-Prod: PROD-35930
Change-Id: I3177c986b0c8f5403f3591b56eaf77ed188a7c71
diff --git a/dogtag/meta/backupninja.yml b/dogtag/meta/backupninja.yml
index fed75fc..6fcc541 100644
--- a/dogtag/meta/backupninja.yml
+++ b/dogtag/meta/backupninja.yml
@@ -4,6 +4,7 @@
handler: sh
actions:
- cmd: |
+ rm -rf /var/lib/dirsrv/slapd-pki-tomcat/bak/*
grep internal= /var/lib/pki/pki-tomcat/conf/password.conf | awk -F= '{print $2}' > /etc/dogtag/internal.txt
grep internaldb= /var/lib/pki/pki-tomcat/conf/password.conf | awk -F= '{print $2}' > /etc/dogtag/pass.txt
PKCS12Export -debug -d /var/lib/pki/pki-tomcat/alias -p /etc/dogtag/internal.txt -o /etc/dogtag/ca-certs.p12 -w /etc/dogtag/pass.txt