summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Gomes <tiago.gomes@codethink.co.uk>2015-04-28 15:30:37 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-05-01 14:37:37 +0000
commite923ce37fe1e5e822eaf87558195e90c07c6129c (patch)
tree2b953409e001ac51097bd9bdb438b65b21c93976
parentfd85a8d8fd618b25582c1814481c0a76f86492be (diff)
downloaddefinitions-e923ce37fe1e5e822eaf87558195e90c07c6129c.tar.gz
openstack: improve network configuration extension
Also ensure that the /etc/openstack directory exists. Change-Id: I633cf3e9add94ff1d9622062e55b4d15db541cbf
-rw-r--r--openstack-network.configure23
1 files changed, 18 insertions, 5 deletions
diff --git a/openstack-network.configure b/openstack-network.configure
index a4d43a6a..10be5a1c 100644
--- a/openstack-network.configure
+++ b/openstack-network.configure
@@ -18,13 +18,26 @@ set -e
ROOT="$1"
-ln -sf "/usr/lib/systemd/system/openvswitch-setup.service" \
- "$ROOT/etc/systemd/system/multi-user.target.wants/openvswitch-setup.service"
+enable(){
+ ln -sf "/usr/lib/systemd/system/$1.service" \
+ "$ROOT/etc/systemd/system/multi-user.target.wants/$1.service"
+}
-ln -sf "/usr/lib/systemd/system/openstack-network-setup.service" \
- "$ROOT/etc/systemd/system/multi-user.target.wants/openstack-network-setup.service"
+###################
+# Enable services #
+###################
-python <<'EOF' >"$ROOT/etc/openstack/network.conf"
+enable openvswitch-setup
+enable openstack-network-setup
+
+##########################################################################
+# Generate config variable shell snippet
+##########################################################################
+
+OPENSTACK_DATA="$ROOT/etc/openstack"
+mkdir -p "$OPENSTACK_DATA"
+
+python <<'EOF' >"$OPENSTACK_DATA/network.conf"
import os, sys, yaml
network_configuration = {}