forked from metal3-io/metal3-dev-env
-
Notifications
You must be signed in to change notification settings - Fork 0
/
host_cleanup.sh
executable file
·49 lines (43 loc) · 1.6 KB
/
host_cleanup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
set -x
source utils/logging.sh
source utils/common.sh
# Kill and remove the running ironic containers
for name in ironic ironic-inspector dnsmasq httpd mariadb; do
sudo podman ps | grep -w "$name$" && sudo podman kill $name
sudo podman ps --all | grep -w "$name$" && sudo podman rm $name -f
done
# Remove existing pod
if sudo podman pod exists ironic-pod ; then
sudo podman pod rm ironic-pod -f
fi
ANSIBLE_FORCE_COLOR=true ansible-playbook \
-e "working_dir=$WORKING_DIR" \
-e "num_masters=$NUM_MASTERS" \
-e "num_workers=$NUM_WORKERS" \
-e "extradisks=$VM_EXTRADISKS" \
-e "virthost=$HOSTNAME" \
-e "manage_baremetal=$MANAGE_BR_BRIDGE" \
-e @vm-setup/config/environments/dev_privileged_libvirt.yml \
-i vm-setup/tripleo-quickstart-config/metalkube-inventory.ini \
-b -vvv vm-setup/tripleo-quickstart-config/metalkube-teardown-playbook.yml
sudo rm -rf /etc/NetworkManager/conf.d/dnsmasq.conf
# There was a bug in this file, it may need to be recreated.
if [ "$MANAGE_PRO_BRIDGE" == "y" ]; then
sudo rm -f /etc/sysconfig/network-scripts/ifcfg-provisioning
fi
# Leaving this around causes issues when the host is rebooted
if [ "$MANAGE_BR_BRIDGE" == "y" ]; then
sudo rm -f /etc/sysconfig/network-scripts/ifcfg-baremetal
fi
sudo virsh net-list --name|grep -q baremetal
if [ "$?" == "0" ]; then
sudo virsh net-destroy baremetal
sudo virsh net-undefine baremetal
fi
sudo virsh net-list --name|grep -q provisioning
if [ "$?" == "0" ]; then
sudo virsh net-destroy provisioning
sudo virsh net-undefine provisioning
fi
sudo rm -rf /root/.vbmc