4 # shellcheck disable=SC1091
6 # shellcheck disable=SC1091
9 # Kill and remove the running ironic containers
10 for name in ironic ironic-inspector dnsmasq httpd mariadb; do
11 sudo "${CONTAINER_RUNTIME}" ps | grep -w "$name$" && sudo "${CONTAINER_RUNTIME}" kill $name
12 sudo "${CONTAINER_RUNTIME}" ps --all | grep -w "$name$" && sudo "${CONTAINER_RUNTIME}" rm $name -f
16 if [[ "${CONTAINER_RUNTIME}" == "podman" ]]; then
17 if sudo "${CONTAINER_RUNTIME}" pod exists ironic-pod ; then
18 sudo "${CONTAINER_RUNTIME}" pod rm ironic-pod -f
22 # Kill the locally running operators
23 if [ "${BMO_RUN_LOCAL}" = true ]; then
24 kill "$(pgrep "operator-sdk")" 2> /dev/null || true
26 if [ "${CAPBM_RUN_LOCAL}" = true ]; then
27 CAPBM_PARENT_PID="$(pgrep -f "go run ./cmd/manager/main.go")"
28 if [[ "${CAPBM_PARENT_PID}" != "" ]]; then
29 CAPBM_GO_PID="$(pgrep -P "${CAPBM_PARENT_PID}" )"
30 kill "${CAPBM_GO_PID}" 2> /dev/null || true
35 ANSIBLE_FORCE_COLOR=true ansible-playbook \
36 -e "working_dir=$WORKING_DIR" \
37 -e "num_masters=$NUM_MASTERS" \
38 -e "num_workers=$NUM_WORKERS" \
39 -e "extradisks=$VM_EXTRADISKS" \
40 -e "virthost=$HOSTNAME" \
41 -e "manage_baremetal=$MANAGE_BR_BRIDGE" \
42 -i vm-setup/inventory.ini \
43 -b -vvv vm-setup/teardown-playbook.yml
45 sudo rm -rf /etc/NetworkManager/conf.d/dnsmasq.conf
46 # There was a bug in this file, it may need to be recreated.
47 if [ "$MANAGE_PRO_BRIDGE" == "y" ]; then
48 sudo ifdown provisioning || true
49 sudo rm -f /etc/sysconfig/network-scripts/ifcfg-provisioning || true
51 # Leaving this around causes issues when the host is rebooted
52 if [ "$MANAGE_BR_BRIDGE" == "y" ]; then
53 sudo ifdown baremetal || true
54 sudo rm -f /etc/sysconfig/network-scripts/ifcfg-baremetal || true