Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 1 | ## Base packages and setup |
Filip Pytloun | 2516a61 | 2016-02-12 10:50:29 +0100 | [diff] [blame] | 2 | export DEBIAN_FRONTEND=noninteractive |
Filip Pytloun | cb52dd5 | 2016-02-01 10:42:54 +0100 | [diff] [blame] | 3 | echo "exit 101" > /usr/sbin/policy-rc.d |
| 4 | chmod +x /usr/sbin/policy-rc.d |
Filip Pytloun | 2516a61 | 2016-02-12 10:50:29 +0100 | [diff] [blame] | 5 | apt-get clean |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 6 | apt-get update |
| 7 | |
Filip Pytloun | 4c96999 | 2017-02-20 14:42:09 +0100 | [diff] [blame^] | 8 | # Useful tools |
| 9 | apt-get -y install curl wget tmux vim-nox byobu iputils-ping traceroute htop tree |
| 10 | |
| 11 | # Add apt-mk repository |
| 12 | echo "deb [arch=amd64] http://apt-mk.mirantis.com/xenial/ nightly extra salt salt-latest" > /etc/apt/sources.list.d/apt-mk.list |
| 13 | curl -sf http://apt-mk.mirantis.com/public.gpg | apt-key add - |
| 14 | |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 15 | # Cleanup old kernels, ensure latest is installed via virtual package |
Filip Pytloun | 30a5076 | 2016-01-19 14:50:45 +0100 | [diff] [blame] | 16 | #apt-get purge -y linux-image-* linux-headers-* |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 17 | if [ ! -f /tmp/no_install_kernel ]; then |
Filip Pytloun | 30a5076 | 2016-01-19 14:50:45 +0100 | [diff] [blame] | 18 | # apt-get install -y linux-generic-lts-vivid |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 19 | |
| 20 | # Update grub cmdline |
| 21 | sed -i 's|GRUB_CMDLINE_LINUX_DEFAULT=.*|GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8"|g' /etc/default/grub |
| 22 | sed -i 's|GRUB_CMDLINE_LINUX=.*|GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"|g' /etc/default/grub |
| 23 | update-grub |
| 24 | fi |
| 25 | |
| 26 | apt-get -y upgrade |
| 27 | apt-get -y dist-upgrade |
| 28 | |
| 29 | apt-get autoremove --purge |
| 30 | |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 31 | # Tmux fixes |
| 32 | cat << 'EOF' >> /etc/tmux.conf |
| 33 | set -g default-terminal "screen-256color" |
| 34 | set -g set-titles on |
| 35 | set -g xterm-keys on |
| 36 | EOF |
| 37 | |
| 38 | # Setup cloud-init |
| 39 | apt-get -y install cloud-init |
Filip Pytloun | 4c96999 | 2017-02-20 14:42:09 +0100 | [diff] [blame^] | 40 | |
| 41 | # Motd |
| 42 | apt-get install -y update-motd |
| 43 | rm -f /etc/update-motd.d/* |
| 44 | cat << EOF >> /etc/update-motd.d/52-info |
| 45 | Ubuntu 16.04 "Xenial" Mirantis cloud image |
| 46 | Build date: $(date -u -R) |
| 47 | |
| 48 | EOF |
| 49 | chmod +x /etc/update-motd.d/52-info |