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