X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=deploy%2Fmetal3-vm%2F05_host_cleanup.sh;h=1e69d12945cabc83bad78ad071552f2ab336e5b9;hb=30b77af0fb5fc89e7b9e76f4e6e33aaf82832945;hp=5c49a35a471002b349837fd5743465e085f2f09b;hpb=97aec506decb655c865452acb5b5fcef72bb8673;p=icn.git diff --git a/deploy/metal3-vm/05_host_cleanup.sh b/deploy/metal3-vm/05_host_cleanup.sh index 5c49a35..1e69d12 100755 --- a/deploy/metal3-vm/05_host_cleanup.sh +++ b/deploy/metal3-vm/05_host_cleanup.sh @@ -1,24 +1,20 @@ #!/usr/bin/env bash -set -x +set -eux -o pipefail # shellcheck disable=SC1091 source lib/logging.sh # shellcheck disable=SC1091 source lib/common.sh +BMO_RUN_LOCAL="${BMO_RUN_LOCAL:-false}" +CAPBM_RUN_LOCAL="${CAPBM_RUN_LOCAL:-false}" + # Kill and remove the running ironic containers -for name in ironic ironic-inspector dnsmasq httpd mariadb; do +for name in ironic ironic-inspector dnsmasq httpd mariadb ipa-downloader; do sudo "${CONTAINER_RUNTIME}" ps | grep -w "$name$" && sudo "${CONTAINER_RUNTIME}" kill $name sudo "${CONTAINER_RUNTIME}" ps --all | grep -w "$name$" && sudo "${CONTAINER_RUNTIME}" rm $name -f done -# Remove existing pod -if [[ "${CONTAINER_RUNTIME}" == "podman" ]]; then - if sudo "${CONTAINER_RUNTIME}" pod exists ironic-pod ; then - sudo "${CONTAINER_RUNTIME}" pod rm ironic-pod -f - fi -fi - # Kill the locally running operators if [ "${BMO_RUN_LOCAL}" = true ]; then kill "$(pgrep "operator-sdk")" 2> /dev/null || true @@ -45,11 +41,14 @@ ANSIBLE_FORCE_COLOR=true ansible-playbook \ 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 ifdown provisioning || true + sudo ip link set dev provisioning down || true sudo rm -f /etc/sysconfig/network-scripts/ifcfg-provisioning || true fi # Leaving this around causes issues when the host is rebooted if [ "$MANAGE_BR_BRIDGE" == "y" ]; then - sudo ifdown baremetal || true + sudo ip link set dev baremetal down || true sudo rm -f /etc/sysconfig/network-scripts/ifcfg-baremetal || true fi + +rm -rf $WORKING_DIR +rm -rf $IRONIC_DATA_DIR