summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Gomes <tiago.gomes@codethink.co.uk>2015-04-28 15:30:37 (GMT)
committerTiago Gomes <tiago.gomes@codethink.co.uk>2015-05-01 14:13:14 (GMT)
commit792e3d5cd79c76c912ace410a17fa45275f4a439 (patch)
tree57506171c5be9ddca6f0a63abb2731d19b2a5821
parent55496bf01f072f9b45e9ec7733c4bf02080bb3a0 (diff)
downloaddefinitions-792e3d5cd79c76c912ace410a17fa45275f4a439.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 a4d43a6..10be5a1 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 = {}