summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Gomes <tiago.gomes@codethink.co.uk>2015-04-28 15:30:37 +0000
committerTiago Gomes <tiago.gomes@codethink.co.uk>2015-04-29 16:09:37 +0000
commitc05e7d604d90edc97ac21a4cac7b04939efe9a60 (patch)
tree7a5ae8109ddd2f08b06a3ac751a5c3563f3ec285
parente9c7b9baa8a702e9cce36cda7066efc8bde1d126 (diff)
downloaddefinitions-c05e7d604d90edc97ac21a4cac7b04939efe9a60.tar.gz
openstack: improve network configuration extension
Also ensure that the /etc/openstack directory exists.
-rw-r--r--openstack-network.configure21
1 files changed, 17 insertions, 4 deletions
diff --git a/openstack-network.configure b/openstack-network.configure
index a4d43a6a..3037bb9e 100644
--- a/openstack-network.configure
+++ b/openstack-network.configure
@@ -18,11 +18,24 @@ 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 #
+###################
+
+enable openvswitch-setup
+enable openstack-network-setup
+
+##########################################################################
+# Generate config variable shell snippet
+##########################################################################
+
+OPENSTACK_DATA="$ROOT/etc/openstack"
+mkdir -p "$OPENSTACK_DATA"
python <<'EOF' >"$ROOT/etc/openstack/network.conf"
import os, sys, yaml