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