diff options
-rw-r--r-- | clusters/openstack-one-node.morph | 1 | ||||
-rw-r--r-- | clusters/openstack-three-node-installer.morph | 3 | ||||
-rw-r--r-- | clusters/openstack-two-node-installer.morph | 3 | ||||
-rw-r--r-- | openstack-glance.configure | 48 |
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 ########################################################################## |