summaryrefslogtreecommitdiffstats
path: root/ci/trusty/ubuntu-nodes-controller/hooks/install
blob: 17265f56f0929eb0760c2b5cc6bf5026a6583609 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash

set -e
set -u

## install lxc pre-configuration to setup multiple interfaces
status-set maintenance "setting up lxc clone hook" || true
mkdir -p /usr/local/share/lxc/hooks/
install -m 755 lxc/add-more-interfaces /usr/local/share/lxc/hooks/

dpkg-divert --local \
    --divert /usr/share/lxc/config/ubuntu-cloud.trusty.conf.ubuntu.orig \
    --add /usr/share/lxc/config/ubuntu-cloud.trusty.conf
mkdir -p /usr/share/lxc/config/
install -m 644 lxc/ubuntu-cloud.trusty.conf /usr/share/lxc/config/

## network interfaces
status-set maintenance "setting up network interfaces" || true
apt-get update || true
apt-get install -y ifenslave ethtool bridge-utils vlan

if ! grep -q 8021q /etc/modules; then
    echo 8021q >> /etc/modules
fi

## write /etc/network/interfaces for the host
install -m 644 network/interfaces.host /etc/network/interfaces
ifup -a

status-set active || true