diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2015-04-15 07:16:42 +0000 |
---|---|---|
committer | Francisco Redondo Marchena <francisco.marchena@codethink.co.uk> | 2015-04-16 16:30:44 +0000 |
commit | 8f307fcf4cb9b352d4c9c5c4f245601e48641469 (patch) | |
tree | 9ee1dbd999ec5e46e7471b1570447c139564800f /openstack-cinder.configure | |
parent | c975815f5810553709ca967e52bbfa5fc61d3216 (diff) | |
download | definitions-8f307fcf4cb9b352d4c9c5c4f245601e48641469.tar.gz |
OpenStack: Split Cinder into config, db and lv setupbaserock/openstack-in-baserock-3-nodes
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 ########################################################################## |