misc updates

  * Wait for salt-master and salt-minion to wake up after restart
  * fix aptly publisher config path
  * refactor cleanup
  * remove multiverse from ubuntu_base.
    It was never packed into offline - so, should be safe to remove.

Change-Id: Ic5bd8d8085af5db10d52063bff50be41031ef248
diff --git a/common/ubuntu_base.sh b/common/ubuntu_base.sh
index 336662b..10f42c0 100644
--- a/common/ubuntu_base.sh
+++ b/common/ubuntu_base.sh
@@ -1,6 +1,7 @@
 #!/bin/bash -xe
 
-if [ -f /tmp/done_ubuntu_base ] ; then
+# Don't use /tmp/ - some templates do node reboot
+if [ -f /done_ubuntu_base ] ; then
   echo "INFO: ubuntu_base already finished.Skipping.."
   exit 0
 fi
@@ -27,10 +28,10 @@
 
 sysctl -w fs.file-max=100000
 # Overwrite default mirrors
-echo "deb [arch=amd64] ${UBUNTU_BASEURL} xenial main restricted multiverse universe" > /etc/apt/sources.list
-echo "deb [arch=amd64] ${UBUNTU_BASEURL} xenial-updates main restricted multiverse universe" >> /etc/apt/sources.list
-echo "deb [arch=amd64] ${UBUNTU_BASEURL} xenial-security main restricted multiverse universe" >> /etc/apt/sources.list
-#echo "deb [arch=amd64] ${UBUNTU_BASEURL} xenial-backports main restricted multiverse universe" >> /etc/apt/sources.list
+echo "deb [arch=amd64] ${UBUNTU_BASEURL} xenial main restricted universe" > /etc/apt/sources.list
+echo "deb [arch=amd64] ${UBUNTU_BASEURL} xenial-updates main restricted universe" >> /etc/apt/sources.list
+echo "deb [arch=amd64] ${UBUNTU_BASEURL} xenial-security main restricted universe" >> /etc/apt/sources.list
+#echo "deb [arch=amd64] ${UBUNTU_BASEURL} xenial-backports main restricted universe" >> /etc/apt/sources.list
 
 apt-get clean
 apt-get update
@@ -77,4 +78,4 @@
   systemctl stop ${s} || true
 done
 
-touch /tmp/done_ubuntu_base
+touch /done_ubuntu_base