Use apt-mk repository

Change-Id: I3a770c58f0c6c5fde8e58ee2f13e61e7c07e6248
diff --git a/ubuntu-14.04/http/preseed-lvm.cfg b/ubuntu-14.04/http/preseed-lvm.cfg
index 0b12180..859c20c 100644
--- a/ubuntu-14.04/http/preseed-lvm.cfg
+++ b/ubuntu-14.04/http/preseed-lvm.cfg
@@ -1,7 +1,3 @@
-d-i apt-setup/use_mirror boolean false
-d-i apt-setup/local0/repository string [arch=amd64] http://apt.tcpcloud.eu/nightly trusty main security extra tcp
-d-i apt-setup/local0/key string http://apt.tcpcloud.eu/public.gpg
-
 d-i debian-installer/framebuffer boolean false
 d-i debconf/frontend select noninteractive
 d-i base-installer/kernel/override-image string linux-server
diff --git a/ubuntu-14.04/http/preseed.cfg b/ubuntu-14.04/http/preseed.cfg
index 9943216..9fb55b1 100644
--- a/ubuntu-14.04/http/preseed.cfg
+++ b/ubuntu-14.04/http/preseed.cfg
@@ -1,7 +1,3 @@
-d-i apt-setup/use_mirror boolean false
-d-i apt-setup/local0/repository string [arch=amd64] http://apt.tcpcloud.eu/nightly trusty main security extra tcp
-d-i apt-setup/local0/key string http://apt.tcpcloud.eu/public.gpg
-
 d-i debian-installer/framebuffer boolean false
 d-i debconf/frontend select noninteractive
 d-i base-installer/kernel/override-image string linux-server
diff --git a/ubuntu-14.04/scripts/base.sh b/ubuntu-14.04/scripts/base.sh
index 1358b64..68c295b 100644
--- a/ubuntu-14.04/scripts/base.sh
+++ b/ubuntu-14.04/scripts/base.sh
@@ -1,13 +1,17 @@
 ## Base packages and setup
-# Ensure our repository is the only one present
-echo "deb [arch=amd64] http://apt.tcpcloud.eu/nightly/ trusty main security extra tcp tcp-salt" > /etc/apt/sources.list
-
 export DEBIAN_FRONTEND=noninteractive
 echo "exit 101" > /usr/sbin/policy-rc.d
 chmod +x /usr/sbin/policy-rc.d
 apt-get clean
 apt-get update
 
+# Useful tools
+apt-get -y install curl wget tmux vim-nox byobu iputils-ping traceroute htop tree
+
+# Add apt-mk repository
+echo "deb [arch=amd64] http://apt-mk.mirantis.com/trusty/ nightly extra salt salt-latest" > /etc/apt/sources.list.d/apt-mk.list
+curl -sf http://apt-mk.mirantis.com/public.gpg | apt-key add -
+
 # Cleanup old kernels, ensure latest is installed via virtual package
 apt-get purge -y linux-image-* linux-headers-*
 if [ ! -f /tmp/no_install_kernel ]; then
@@ -24,9 +28,6 @@
 
 apt-get autoremove --purge
 
-# Useful tools
-apt-get -y install curl wget tmux vim-nox byobu iputils-ping traceroute htop tree
-
 # Tmux fixes
 cat << 'EOF' >> /etc/tmux.conf
 set -g default-terminal "screen-256color"
@@ -36,3 +37,13 @@
 
 # Setup cloud-init
 apt-get -y install cloud-init
+
+# Motd
+apt-get install -y update-motd
+rm -f /etc/update-motd.d/*
+cat << EOF >> /etc/update-motd.d/52-info
+Ubuntu 14.04 "Trusty" Mirantis cloud image
+Build date: $(date -u -R)
+
+EOF
+chmod +x /etc/update-motd.d/52-info
diff --git a/ubuntu-14.04/scripts/docker.sh b/ubuntu-14.04/scripts/docker.sh
index ba1beeb..3f2dc82 100644
--- a/ubuntu-14.04/scripts/docker.sh
+++ b/ubuntu-14.04/scripts/docker.sh
@@ -2,8 +2,9 @@
 
 apt-get -y install curl
 
-echo "deb [arch=amd64] http://apt.tcpcloud.eu/nightly trusty main security extra tcp" >/etc/apt/sources.list
-curl -s http://apt.tcpcloud.eu/public.gpg | apt-key add -
+# Add apt-mk repository
+echo "deb [arch=amd64] http://apt-mk.mirantis.com/trusty/ nightly extra salt salt-latest" > /etc/apt/sources.list.d/apt-mk.list
+curl -sf http://apt-mk.mirantis.com/public.gpg | apt-key add -
 
 apt-get update
 
diff --git a/ubuntu-16.04/http/preseed.cfg b/ubuntu-16.04/http/preseed.cfg
index 3ca71b1..f30360c 100644
--- a/ubuntu-16.04/http/preseed.cfg
+++ b/ubuntu-16.04/http/preseed.cfg
@@ -4,10 +4,6 @@
 
 d-i pkgsel/install-language-support boolean false
 
-d-i apt-setup/use_mirror boolean false
-d-i apt-setup/local0/repository string [arch=amd64] http://apt.tcpcloud.eu/nightly xenial main security extra tcp
-d-i apt-setup/local0/key string http://apt.tcpcloud.eu/public.gpg
-
 d-i debian-installer/framebuffer boolean false
 d-i debconf/frontend select noninteractive
 d-i base-installer/kernel/override-image string linux-server
diff --git a/ubuntu-16.04/scripts/base.sh b/ubuntu-16.04/scripts/base.sh
index 2a2536c..07261d2 100644
--- a/ubuntu-16.04/scripts/base.sh
+++ b/ubuntu-16.04/scripts/base.sh
@@ -1,13 +1,17 @@
 ## Base packages and setup
-# Ensure our repository is the only one present
-echo "deb [arch=amd64] http://apt.tcpcloud.eu/nightly/ xenial main security extra tcp tcp-salt" > /etc/apt/sources.list
-
 export DEBIAN_FRONTEND=noninteractive
 echo "exit 101" > /usr/sbin/policy-rc.d
 chmod +x /usr/sbin/policy-rc.d
 apt-get clean
 apt-get update
 
+# Useful tools
+apt-get -y install curl wget tmux vim-nox byobu iputils-ping traceroute htop tree
+
+# Add apt-mk repository
+echo "deb [arch=amd64] http://apt-mk.mirantis.com/xenial/ nightly extra salt salt-latest" > /etc/apt/sources.list.d/apt-mk.list
+curl -sf http://apt-mk.mirantis.com/public.gpg | apt-key add -
+
 # Cleanup old kernels, ensure latest is installed via virtual package
 #apt-get purge -y linux-image-* linux-headers-*
 if [ ! -f /tmp/no_install_kernel ]; then
@@ -24,9 +28,6 @@
 
 apt-get autoremove --purge
 
-# Useful tools
-apt-get -y install curl wget tmux vim-nox byobu iputils-ping traceroute htop tree
-
 # Tmux fixes
 cat << 'EOF' >> /etc/tmux.conf
 set -g default-terminal "screen-256color"
@@ -36,3 +37,13 @@
 
 # Setup cloud-init
 apt-get -y install cloud-init
+
+# Motd
+apt-get install -y update-motd
+rm -f /etc/update-motd.d/*
+cat << EOF >> /etc/update-motd.d/52-info
+Ubuntu 16.04 "Xenial" Mirantis cloud image
+Build date: $(date -u -R)
+
+EOF
+chmod +x /etc/update-motd.d/52-info
diff --git a/ubuntu-16.04/scripts/docker.sh b/ubuntu-16.04/scripts/docker.sh
index c19b624..59bfdfe 100644
--- a/ubuntu-16.04/scripts/docker.sh
+++ b/ubuntu-16.04/scripts/docker.sh
@@ -3,8 +3,9 @@
 apt-get update
 apt-get -y install curl
 
-echo "deb [arch=amd64] http://apt.tcpcloud.eu/nightly xenial main security extra tcp" >/etc/apt/sources.list
-curl -s http://apt.tcpcloud.eu/public.gpg | apt-key add -
+# Add apt-mk repository
+echo "deb [arch=amd64] http://apt-mk.mirantis.com/xenial/ nightly extra salt salt-latest" > /etc/apt/sources.list.d/apt-mk.list
+curl -sf http://apt-mk.mirantis.com/public.gpg | apt-key add -
 
 apt-get clean
 apt-get update