summaryrefslogtreecommitdiffstats
path: root/ci/trusty/ubuntu-nodes-compute/hooks
diff options
context:
space:
mode:
authorNarinder Gupta <narinder.gupta@canonical.com>2015-11-07 00:38:58 -0600
committerNarinder Gupta <narinder.gupta@canonical.com>2015-11-07 00:42:36 -0600
commit3ff5b9114e07349bb4a4b5578394bd799950dcf6 (patch)
treebf19af5d90f4a343218b8e260fa20638d2057357 /ci/trusty/ubuntu-nodes-compute/hooks
parentebefaf35b2909bcc41d8ba3917228b7ccba7ce2e (diff)
added ubuntu charm for local deployment charm to configure the
network according to the labs. Change-Id: I103b6dc243f025a4916d1057c247d01ee8f175ee
Diffstat (limited to 'ci/trusty/ubuntu-nodes-compute/hooks')
-rwxr-xr-xci/trusty/ubuntu-nodes-compute/hooks/install30
1 files changed, 30 insertions, 0 deletions
diff --git a/ci/trusty/ubuntu-nodes-compute/hooks/install b/ci/trusty/ubuntu-nodes-compute/hooks/install
new file mode 100755
index 00000000..17265f56
--- /dev/null
+++ b/ci/trusty/ubuntu-nodes-compute/hooks/install
@@ -0,0 +1,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