summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Gomes <tiago.gomes@codethink.co.uk>2015-04-28 13:12:28 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-05-01 12:21:46 +0000
commit8768d5d77a1a1b5f65e0856cfa41dc2861590200 (patch)
tree9cfe164cbd845d0a884763c7d6f2968ae8bf47cd
parentcbbbca7493e907a0670c2cff39d8d341ce2915d8 (diff)
downloaddefinitions-8768d5d77a1a1b5f65e0856cfa41dc2861590200.tar.gz
openstack: enable glance only in the controller
Change-Id: I506525f48952b1807732fb726aa16f9f33e608d7
-rw-r--r--clusters/openstack-one-node.morph1
-rw-r--r--clusters/openstack-three-node-installer.morph3
-rw-r--r--clusters/openstack-two-node-installer.morph3
-rw-r--r--openstack-glance.configure48
4 files changed, 39 insertions, 16 deletions
diff --git a/clusters/openstack-one-node.morph b/clusters/openstack-one-node.morph
index 497a0ba4..037cd23c 100644
--- a/clusters/openstack-one-node.morph
+++ b/clusters/openstack-one-node.morph
@@ -61,6 +61,7 @@ systems:
KEYSTONE_DB_USER: keystoneDB
KEYSTONE_DB_PASSWORD: veryinsecure
+ GLANCE_ENABLE_SERVICE: True
GLANCE_SERVICE_USER: glance
GLANCE_SERVICE_PASSWORD: veryinsecure
GLANCE_DB_USER: glanceDB
diff --git a/clusters/openstack-three-node-installer.morph b/clusters/openstack-three-node-installer.morph
index ff82f20f..6285217a 100644
--- a/clusters/openstack-three-node-installer.morph
+++ b/clusters/openstack-three-node-installer.morph
@@ -96,6 +96,7 @@ systems:
KEYSTONE_DB_USER: keystoneDB
KEYSTONE_DB_PASSWORD: veryinsecure
+ GLANCE_ENABLE_SERVICE: False
GLANCE_SERVICE_USER: glance
GLANCE_SERVICE_PASSWORD: veryinsecure
GLANCE_DB_USER: glanceDB
@@ -174,6 +175,8 @@ systems:
KEYSTONE_ENABLE_SERVICE: True
+ GLANCE_ENABLE_SERVICE: True
+
NOVA_ENABLE_CONTROLLER: True
CINDER_ENABLE_CONTROLLER: True
diff --git a/clusters/openstack-two-node-installer.morph b/clusters/openstack-two-node-installer.morph
index 93d126bc..f05b0e9b 100644
--- a/clusters/openstack-two-node-installer.morph
+++ b/clusters/openstack-two-node-installer.morph
@@ -95,6 +95,7 @@ systems:
KEYSTONE_DB_USER: keystoneDB
KEYSTONE_DB_PASSWORD: veryinsecure
+ GLANCE_ENABLE_SERVICE: True
GLANCE_SERVICE_USER: glance
GLANCE_SERVICE_PASSWORD: veryinsecure
GLANCE_DB_USER: glanceDB
@@ -171,6 +172,8 @@ systems:
KEYSTONE_ENABLE_SERVICE: False
+ GLANCE_ENABLE_SERVICE: False
+
NOVA_ENABLE_COMPUTE: True
NOVA_ENABLE_CONTROLLER: False
diff --git a/openstack-glance.configure b/openstack-glance.configure
index 44b4d6aa..5da08895 100644
--- a/openstack-glance.configure
+++ b/openstack-glance.configure
@@ -18,28 +18,38 @@ set -e
ROOT="$1"
-##########################################################################
+enable(){
+ ln -sf "/usr/lib/systemd/system/$1.service" \
+ "$ROOT/etc/systemd/system/multi-user.target.wants/$1.service"
+}
+
+unnaceptable(){
+ eval echo Unexpected value \$$1 for $1 >&2
+ exit 1
+}
-ln -s "/usr/lib/systemd/system/openstack-glance-setup.service" \
- "$ROOT/etc/systemd/system/multi-user.target.wants/openstack-glance-setup.service"
+check_bool(){
+ case "$(eval echo \"\$$1\")" in
+ True|'')
+ eval "$1=true"
+ ;;
+ False)
+ eval "$1=false"
+ ;;
+ *)
+ unnaceptable "$1"
+ ;;
+ esac
+}
##########################################################################
# Check variables
##########################################################################
-if [ -z "$KEYSTONE_TEMPORARY_ADMIN_TOKEN" -a \
- -z "$GLANCE_SERVICE_USER" -a \
- -z "$GLANCE_SERVICE_PASSWORD" -a \
- -z "$GLANCE_DB_USER" -a \
- -z "$GLANCE_DB_PASSWORD" -a \
- -z "$RABBITMQ_HOST" -a \
- -z "$RABBITMQ_PORT" -a \
- -z "$RABBITMQ_USER" -a \
- -z "$RABBITMQ_PASSWORD" -a \
- -z "$MANAGEMENT_INTERFACE_IP_ADDRESS" -a \
- -z "$CONTROLLER_HOST_ADDRESS" ]; then
- # No Glance options defined, do nothing.
- exit 0
+check_bool GLANCE_ENABLE_SERVICE
+
+if ! "$GLANCE_ENABLE_SERVICE"; then
+ exit 0
fi
if [ -z "$KEYSTONE_TEMPORARY_ADMIN_TOKEN" -o \
@@ -57,6 +67,12 @@ if [ -z "$KEYSTONE_TEMPORARY_ADMIN_TOKEN" -o \
exit 1
fi
+######################################
+# Enable relevant openstack services #
+######################################
+
+enable openstack-glance-setup
+
##########################################################################
# Generate configuration file
##########################################################################