diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2015-04-15 07:16:42 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-04-17 15:35:24 +0000 |
commit | 4d37f04a808298da53d720b85ca1bfb0f866e3bc (patch) | |
tree | e5d294d0ada3983c7fc92bb32d36c54b6d46c6db /openstack-cinder.configure | |
parent | 16ec568ee57045464cd2435358a28c25820a6a61 (diff) | |
download | definitions-4d37f04a808298da53d720b85ca1bfb0f866e3bc.tar.gz |
OpenStack: Split Cinder into config, db and lv setup
Change-Id: Iae387e39c4a62ef608496d31c748493fa88ce3e1
Diffstat (limited to 'openstack-cinder.configure')
-rw-r--r-- | openstack-cinder.configure | 57 |
1 files changed, 53 insertions, 4 deletions
diff --git a/openstack-cinder.configure b/openstack-cinder.configure index 0c15bd23..a971dc4c 100644 --- a/openstack-cinder.configure +++ b/openstack-cinder.configure @@ -18,10 +18,10 @@ set -e ROOT="$1" -########################################################################## - -ln -sf "/usr/lib/systemd/system/openstack-cinder-setup.service" \ - "$ROOT/etc/systemd/system/multi-user.target.wants/openstack-cinder-setup.service" +enable(){ + ln -sf "/usr/lib/systemd/system/$1.service" \ + "$ROOT/etc/systemd/system/multi-user.target.wants/$1.service" +} ########################################################################## # Check variables @@ -59,6 +59,55 @@ if [ -z "$RABBITMQ_HOST" -o \ exit 1 fi +# Check optional variables + +unnaceptable(){ + eval echo Unexpected value \$$1 for $1 >&2 + exit 1 +} + +check_bool(){ + case "$(eval echo \"\$$1\")" in + True|'') + eval "$1=true" + ;; + False) + eval "$1=false" + ;; + *) + unnaceptable "$1" + ;; + esac +} + +check_bool CINDER_ENABLE_CONTROLLER +check_bool CINDER_ENABLE_COMPUTE +check_bool CINDER_ENABLE_STORAGE + +###################################### +# Enable relevant openstack services # +###################################### + +if "$CINDER_ENABLE_COMPUTE" || "$CINDER_ENABLE_STORAGE"; then + enable openstack-cinder-iscsi-setup + enable target #target.service! + enable iscsid +fi +if "$CINDER_ENABLE_COMPUTE" || "$CINDER_ENABLE_CONTROLLER"; then + enable openstack-cinder-config-setup +fi +if "$CINDER_ENABLE_STORAGE"; then + enable openstack-cinder-lv-setup + enable lvm2-lvmetad + enable openstack-cinder-volume + enable openstack-cinder-backup + enable openstack-cinder-scheduler +fi +if "$CINDER_ENABLE_CONTROLLER"; then + enable openstack-cinder-db-setup + enable openstack-cinder-api +fi + ########################################################################## # Generate configuration file ########################################################################## |