03fca87fe470fe3bb304a90cc1013f0453476e78
[icn.git] / env / metal3 / 06_host_cleanup.sh
1 #!/usr/bin/env bash
2 set -x
3 LIBDIR="$(dirname "$PWD")"
4
5 source $LIBDIR/lib/common.sh
6
7 # Kill and remove the running ironic containers
8 for name in ironic ironic-inspector dnsmasq httpd mariadb; do
9     sudo podman ps | grep -w "$name$" && sudo podman kill $name
10     sudo podman ps --all | grep -w "$name$" && sudo podman rm $name -f
11 done
12
13 # Remove existing pod
14 if  sudo podman  pod exists ironic-pod ; then
15     sudo podman  pod rm ironic-pod -f
16 fi
17
18 ip link set provisioning down
19 brctl delbr provisioning
20
21 ip link set dhcp0 down
22 brctl delbr dhcp0
23
24 rm -rf ${BS_DHCP_DIR}
25 rm -rf ${IRONIC_DATA_DIR}