Files
training-labs/labs/osbash/scripts/ubuntu/apt_upgrade.sh
Roger Luethi c5fdafc900 Newton updates
This changeset contains updates for Newton.

Notable changes include:
- Ubuntu 14.04 LTS (trusty) replaced by Ubuntu 16.04 LTS (xenial)
- Higher RAM requirements, the controller VM needs 5120 MB
- Script order changed (install-guide changes)
- By default, mariadb does not use a root password but socket auth (sudo)
- Nova does not configure any default flavors anymore; we create m1.nano
  and that's all there is when the cluster is built.
- Remaining differences to install-guide marked in the source code
- As always, new races fixed

Change-Id: Id59e145140252c4384584a3899e01a38e8a57158
2016-10-17 13:40:06 +02:00

57 lines
1.9 KiB
Bash
Executable File

#!/usr/bin/env bash
set -o errexit -o nounset
TOP_DIR=$(cd "$(dirname "$0")/.." && pwd)
source "$TOP_DIR/config/paths"
source "$CONFIG_DIR/openstack"
source "$LIB_DIR/functions.guest.sh"
indicate_current_auto
exec_logfile
#------------------------------------------------------------------------------
# Finalize the installation
# http://docs.openstack.org/mitaka/install-guide-ubuntu/environment-packages.html
#------------------------------------------------------------------------------
# Note: We assume that apt_init.sh set up repos and updated the apt index files
# Upgrade installed packages and the kernel
# Keep our changes to /etc/sudoers from tripping up apt-get
sudo DEBIAN_FRONTEND=noninteractive apt-get \
-o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
-y upgrade
sudo apt-get -y dist-upgrade
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Extra work not documented in install-guide
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# If we upgraded the kernel, remove the old one
INSTALLED_KERNEL=$(readlink /vmlinuz)
INSTALLED_KERNEL=${INSTALLED_KERNEL#boot/vmlinuz-}
RUNNING_KERNEL=$(uname -r)
if [[ $INSTALLED_KERNEL != $RUNNING_KERNEL ]]; then
echo "Kernel $INSTALLED_KERNEL installed. Removing $RUNNING_KERNEL."
if dpkg -s "linux-image-extra-$RUNNING_KERNEL" >/dev/null 2>&1; then
sudo dpkg --purge "linux-image-extra-$RUNNING_KERNEL"
fi
sudo dpkg --purge "linux-image-$RUNNING_KERNEL"
sudo dpkg --purge "linux-headers-$RUNNING_KERNEL"
fi
# Clean apt cache
sudo apt-get -y autoremove
sudo apt-get -y clean
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Install OpenStack client (install-guide)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Installing OpenStack client."
sudo apt-get install -y python-openstackclient