Make packer debug faster

Change-Id: Ief29d1b742f88b5979a7628889d1511d2c8eb0b1
diff --git a/common/ubuntu_base.sh b/common/ubuntu_base.sh
index 6f314e9..10f1ee9 100644
--- a/common/ubuntu_base.sh
+++ b/common/ubuntu_base.sh
@@ -1,7 +1,11 @@
 #!/bin/bash -xe
 
+if [ -f /tmp/done_ubuntu_base ] ; then
+  echo "INFO: ubuntu_base already finished.Skipping.."
+  exit 0
+fi
+#
 UBUNTU_BASEURL="${UBUNTU_BASEURL:-mirror://mirrors.ubuntu.com/mirrors.txt}"
-
 ## Base packages and setup
 export DEBIAN_FRONTEND=noninteractive
 echo -e '#!/bin/sh\nexit 101' > /usr/sbin/policy-rc.d
@@ -69,3 +73,5 @@
   systemctl disable ${s} || true
   systemctl stop ${s} || true
 done
+
+touch /tmp/done_ubuntu_base
diff --git a/common/ubuntu_salt_bootstrap.sh b/common/ubuntu_salt_bootstrap.sh
index ad3757e..b691d4d 100644
--- a/common/ubuntu_salt_bootstrap.sh
+++ b/common/ubuntu_salt_bootstrap.sh
@@ -1,5 +1,10 @@
 #!/bin/bash -xe
 
+if [ -f '/tmp/done_ubuntu_salt_bootstrap' ]; then
+  echo "INFO: ubuntu_salt_bootstrap already finished! Skipping.."
+  exit 0
+fi
+#
 CLUSTER_NAME=${CLUSTER_NAME:-lost_cluster_name_variable}
 CLUSTER_MODEL=${CLUSTER_MODEL:-https://github.com/Mirantis/mcp-offline-model.git}
 CLUSTER_MODEL_REF=${CLUSTER_MODEL_REF:-master}
@@ -56,3 +61,4 @@
   exit 1
 fi
 bash -x /srv/salt/scripts/bootstrap.sh || true
+touch /tmp/done_ubuntu_salt_bootstrap