summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
Diffstat (limited to 'ci')
-rwxr-xr-xci/clean.sh22
1 files changed, 18 insertions, 4 deletions
diff --git a/ci/clean.sh b/ci/clean.sh
index 265c8484..492b0dc2 100755
--- a/ci/clean.sh
+++ b/ci/clean.sh
@@ -1,17 +1,31 @@
#!/usr/bin/env bash
-#Clean script to uninstall provisioning server for Foreman/QuickStack
+#Clean script to uninstall provisioning server for Apex
#author: Dan Radez (dradez@redhat.com)
#
-#Uses Vagrant and VirtualBox
-#
vm_index=4
+
+# Clean off instack VM
virsh destroy instack 2> /dev/null || echo -n ''
virsh undefine instack --remove-all-storage 2> /dev/null || echo -n ''
-
+virsh vol-delete instack.qcow2 default 2> /dev/null
rm -f /var/lib/libvirt/images/instack.qcow2 2> /dev/null
+
+# Clean off baremetal VMs in case they exist
for i in $(seq 0 $vm_index); do
virsh destroy baremetalbrbm_brbm1_$i 2> /dev/null || echo -n ''
virsh undefine baremetalbrbm_brbm1_$i --remove-all-storage 2> /dev/null || echo -n ''
+ virsh vol-delete baremetalbrbm_brbm1_${i}.qcow2 default 2> /dev/null
rm -f /var/lib/libvirt/images/baremetalbrbm_brbm1_${i}.qcow2 2> /dev/null
done
+
+# Clean off brbm bridges
+virsh net-destroy brbm 2> /dev/null
+virsh net-undefine brbm 2> /dev/null
+vs-vsctl del-br brbm 2> /dev/null
+
+virsh net-destroy brbm1 2> /dev/null
+virsh net-undefine brbm1 2> /dev/null
+vs-vsctl del-br brbm1 2> /dev/null
+
+echo "Cleanup Completed"