Add removal of Zookeeper keys too

This commit is contained in:
Joshua Boniface 2023-09-01 15:42:25 -04:00
parent a4f1d6eedc
commit 05a2c1949d
1 changed files with 6 additions and 2 deletions

View File

@ -12,11 +12,14 @@ echo
for host in $@; do for host in $@; do
echo -n "Purging host ${host}... " echo -n "Purging host ${host}... "
ssh deploy@${host} " ssh deploy@${host} '
sudo systemctl stop pvcnoded; sudo systemctl stop pvcnoded;
sudo systemctl stop ceph-mon@$(hostname -s); sudo systemctl stop ceph-mon@$(hostname -s);
sudo systemctl stop ceph-mgr@$(hostname -s); sudo systemctl stop ceph-mgr@$(hostname -s);
sudo systemctl stop patroni; sudo systemctl stop patroni;
for key in $( echo "ls /" | sudo /usr/share/zookeeper/bin/zkCli.sh | grep --color=none zookeeper | tr -d "[]," | tr " " "\n" | grep -v zookeeper ); do
echo "rmr /${key}" | sudo /usr/share/zookeeper/bin/zkCli.sh;
done
sudo systemctl stop zookeeper; sudo systemctl stop zookeeper;
sudo rm -rf /etc/pvc-install.* /etc/ceph* /etc/patroni* /etc/postgres* /etc/zookeeper* /etc/libvirt*; sudo rm -rf /etc/pvc-install.* /etc/ceph* /etc/patroni* /etc/postgres* /etc/zookeeper* /etc/libvirt*;
sudo rm -rf /var/lib/postgresql /var/lib/zookeeper /var/lib/libvirt; sudo rm -rf /var/lib/postgresql /var/lib/zookeeper /var/lib/libvirt;
@ -31,6 +34,7 @@ for host in $@; do
sudo userdel ceph; sudo userdel ceph;
sudo umount /var/lib/ceph; sudo umount /var/lib/ceph;
sudo mkfs.ext4 /dev/vgx/ceph; sudo mkfs.ext4 /dev/vgx/ceph;
sudo mount /var/lib/ceph" &>/dev/null sudo mount /var/lib/ceph;
' &>/dev/null
echo "done." echo "done."
done done