Update purge script
This commit is contained in:
parent
26dbd082ef
commit
a4f1d6eedc
16
purge.sh
16
purge.sh
|
@ -8,10 +8,19 @@ echo -e "Are you sure you want to continue?"
|
||||||
echo
|
echo
|
||||||
echo -en "To abort, press <Ctrl+C> now. To continue, press <Enter>. "
|
echo -en "To abort, press <Ctrl+C> now. To continue, press <Enter>. "
|
||||||
read
|
read
|
||||||
|
echo
|
||||||
|
|
||||||
for host in $@; do
|
for host in $@; do
|
||||||
|
echo -n "Purging host ${host}... "
|
||||||
ssh deploy@${host} "
|
ssh deploy@${host} "
|
||||||
|
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 patroni;
|
||||||
|
sudo systemctl stop zookeeper;
|
||||||
|
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 /run/ceph;
|
||||||
sudo rm -rf /etc/systemd/system/ceph-*.target.wants;
|
sudo rm -rf /etc/systemd/system/ceph-*.target.wants;
|
||||||
sudo apt purge -y *ceph* *rbd* *rados*;
|
sudo apt purge -y *ceph* *rbd* *rados*;
|
||||||
sudo apt purge -y patroni* postgres* zookeeper* libvirt*
|
sudo apt purge -y patroni* postgres* zookeeper* libvirt*
|
||||||
|
@ -19,12 +28,9 @@ for host in $@; do
|
||||||
sudo apt autoremove --purge -y;
|
sudo apt autoremove --purge -y;
|
||||||
sudo apt clean;
|
sudo apt clean;
|
||||||
sudo apt update;
|
sudo apt update;
|
||||||
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 /run/ceph;
|
|
||||||
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" &
|
sudo mount /var/lib/ceph" &>/dev/null
|
||||||
|
echo "done."
|
||||||
done
|
done
|
||||||
wait
|
|
||||||
|
|
Loading…
Reference in New Issue