remove .ansible directory 77/53577/3
authorPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>
Mon, 12 Mar 2018 15:16:13 +0000 (16:16 +0100)
committerPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>
Mon, 12 Mar 2018 15:32:03 +0000 (16:32 +0100)
It's needed to remove .ansible directory which could be a leftovers by
some other ansible execution enviroment which would affect XCI
deployment.

Change-Id: Ic334ef1ca53878721762b23b238fe9a8aeefa0e0
Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>
bifrost/scripts/destroy-env.sh

index 9763830..73c0222 100755 (executable)
@@ -18,18 +18,19 @@ fi
 rm -rf /opt/stack
 # HOME is normally set by sudo -H
 rm -rf ${HOME}/.config/openstack
+rm -rf ${HOME}/.ansible
 
 # bifrost installs everything on venv so we need to look there if virtualbmc is not installed on the host.
 if which vbmc &>/dev/null || { [[ -e /opt/stack/bifrost/bin/activate ]] && source /opt/stack/bifrost/bin/activate; }; then
-       # Delete all libvirt VMs and hosts from vbmc (look for a port number)
-       for vm in $(vbmc list | awk '/[0-9]/{{ print $2 }}'); do
-               if which virsh &>/dev/null; then
-                       virsh destroy $vm || true
-                       virsh undefine $vm || true
-               fi
-               vbmc delete $vm
-       done
-       which vbmc &>/dev/null || { [[ -e /opt/stack/bifrost/bin/activate ]] && deactivate; }
+    # Delete all libvirt VMs and hosts from vbmc (look for a port number)
+    for vm in $(vbmc list | awk '/[0-9]/{{ print $2 }}'); do
+        if which virsh &>/dev/null; then
+            virsh destroy $vm || true
+            virsh undefine $vm || true
+        fi
+        vbmc delete $vm
+    done
+    which vbmc &>/dev/null || { [[ -e /opt/stack/bifrost/bin/activate ]] && deactivate; }
 fi
 
 # Destroy all XCI VMs if the previous operation failed