Filip Pytloun | 60411d1 | 2015-06-25 21:14:41 +0200 | [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 |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 6 | apt-get update |
Filip Pytloun | e3181af | 2015-06-25 22:11:22 +0200 | [diff] [blame] | 7 | |
Filip Pytloun | 4c96999 | 2017-02-20 14:42:09 +0100 | [diff] [blame] | 8 | # Useful tools |
Filip Pytloun | 59641ac | 2017-03-23 17:06:08 +0100 | [diff] [blame] | 9 | apt-get -y install curl wget tmux vim-nox byobu iputils-ping traceroute htop tree lsof |
Filip Pytloun | 4c96999 | 2017-02-20 14:42:09 +0100 | [diff] [blame] | 10 | |
| 11 | # Add apt-mk repository |
Filip Pytloun | b975949 | 2017-03-22 18:41:00 +0100 | [diff] [blame] | 12 | echo "deb [arch=amd64] http://apt-mk.mirantis.com/trusty/ nightly salt" > /etc/apt/sources.list.d/mcp_salt.list |
| 13 | echo "deb [arch=amd64] http://apt-mk.mirantis.com/trusty/ nightly extra" > /etc/apt/sources.list.d/mcp_extra.list |
Filip Pytloun | 4c96999 | 2017-02-20 14:42:09 +0100 | [diff] [blame] | 14 | curl -sf http://apt-mk.mirantis.com/public.gpg | apt-key add - |
| 15 | |
Filip Pytloun | e3181af | 2015-06-25 22:11:22 +0200 | [diff] [blame] | 16 | # Cleanup old kernels, ensure latest is installed via virtual package |
Filip Pytloun | 896f37b | 2015-06-25 18:35:42 +0200 | [diff] [blame] | 17 | apt-get purge -y linux-image-* linux-headers-* |
Filip Pytloun | 7b48fd2 | 2015-06-30 23:34:01 +0200 | [diff] [blame] | 18 | if [ ! -f /tmp/no_install_kernel ]; then |
Jakub Josef | cbf2015 | 2017-03-10 16:05:08 +0100 | [diff] [blame] | 19 | apt-get install -y linux-generic-lts-xenial |
Filip Pytloun | 7b48fd2 | 2015-06-30 23:34:01 +0200 | [diff] [blame] | 20 | |
| 21 | # Update grub cmdline |
| 22 | sed -i 's|GRUB_CMDLINE_LINUX_DEFAULT=.*|GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8"|g' /etc/default/grub |
| 23 | sed -i 's|GRUB_CMDLINE_LINUX=.*|GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"|g' /etc/default/grub |
| 24 | update-grub |
| 25 | fi |
Filip Pytloun | e3181af | 2015-06-25 22:11:22 +0200 | [diff] [blame] | 26 | |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 27 | apt-get -y upgrade |
| 28 | apt-get -y dist-upgrade |
jan kaufman | dfc08f0 | 2015-04-29 20:17:55 +0200 | [diff] [blame] | 29 | |
Filip Pytloun | e3181af | 2015-06-25 22:11:22 +0200 | [diff] [blame] | 30 | apt-get autoremove --purge |
| 31 | |
Filip Pytloun | 3983236 | 2015-06-25 18:05:47 +0200 | [diff] [blame] | 32 | # Tmux fixes |
| 33 | cat << 'EOF' >> /etc/tmux.conf |
| 34 | set -g default-terminal "screen-256color" |
| 35 | set -g set-titles on |
| 36 | set -g xterm-keys on |
| 37 | EOF |
Filip Pytloun | dd27ad8 | 2015-06-18 11:12:08 +0200 | [diff] [blame] | 38 | |
Petr Micahlec | 50f87e0 | 2017-04-13 11:38:22 +0200 | [diff] [blame^] | 39 | # Install common prerequisites |
| 40 | apt-get -y install apt-transport-https python-apt python-m2crypto python-psutil |
| 41 | |
Filip Pytloun | dd27ad8 | 2015-06-18 11:12:08 +0200 | [diff] [blame] | 42 | # Setup cloud-init |
jan kaufman | 0fcf1a7 | 2015-05-06 10:16:12 +0200 | [diff] [blame] | 43 | apt-get -y install cloud-init |
Filip Pytloun | 4c96999 | 2017-02-20 14:42:09 +0100 | [diff] [blame] | 44 | |
| 45 | # Motd |
| 46 | apt-get install -y update-motd |
| 47 | rm -f /etc/update-motd.d/* |
| 48 | cat << EOF >> /etc/update-motd.d/52-info |
| 49 | Ubuntu 14.04 "Trusty" Mirantis cloud image |
| 50 | Build date: $(date -u -R) |
| 51 | |
| 52 | EOF |
| 53 | chmod +x /etc/update-motd.d/52-info |