#!/bin/bash # vim: sw=4 ts=4 sts=4 et tw=72 : # force any errors to cause the script and job to end in failure set -xeu -o pipefail # Ensure that necessary variables are set to enable noninteractive mode in # commands. export DEBIAN_FRONTEND=noninteractive # additional kernel packages required for docker to fix # aufs failed: driver not supported echo "---> Installing Additional kernel packages required for docker" apt-get update apt-get install "linux-image-extra-$(uname -r)" linux-image-extra-virtual modprobe aufs # Install and configure docker. Use puppetlabs docker which supports # Ubuntu 16.04 puppet module install puppetlabs-docker_platform --version 2.2.1 # do the package install via puppet so that we know it actually installs # properly and it also makes it quieter but with better error reporting echo "---> Installing Group Based Policy requirements" puppet apply /tmp/packer/gbp_packages.pp # configure docker networking so that it does not conflict with LF internal networks # configure docker daemon to listen on port 5555 enabling remote managment # This has to happen before docker gets installed or things go sideways # badly cat < /etc/default/docker # /etc/default/docker DOCKER_OPTS='-H unix:///var/run/docker.sock -H tcp://0.0.0.0:5555 --bip=10.250.0.254/24' EOL # docker echo "---> Installing docker" puppet apply /tmp/packer/docker_setup.pp echo "---> stopping docker" puppet apply -e "service { 'docker': ensure => stopped }" echo "---> cleaning docker configs that break after snapshotting" rm -f /var/lib/docker/repositories-aufs /etc/docker/key.json # OVS echo "---> Installing ovs" puppet module install puppetlabs-vcsrepo puppet apply /tmp/packer/ovs_setup.pp pushd /root/ovs DEB_BUILD_OPTIONS='parallel=8 nocheck' fakeroot debian/rules binary | \ grep 'dpkg-deb: building package' popd # Note this does not actually install OVS. Everytime we've tried to do # that the snapshot system hangs on spin-up for some reason. As such the # final installation will have to be left as a spin-up task # The following is what should be used in the spin-up task # dpkg --install /root/openvswitch-datapath-dkms* && dpkg --install /root/openvswitch-{common,switch}*