From c4cd4140d3bb64a02321918df2f0f9258c6c4148 Mon Sep 17 00:00:00 2001 From: Chmouel Boudjnah Date: Wed, 27 Jun 2012 11:01:40 +0200 Subject: [PATCH] Allow removing services explicitly. - When adding a - (hyphen) at the begining of a service in ENABLED_SERVICES the service will be removed explicitly. Change-Id: I69ce082d13b79aa88426e8012a941c4ae99741f6 --- stack.sh | 10 ++++++++++ stackrc | 7 ++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/stack.sh b/stack.sh index 4523c2c24e..ade8710531 100755 --- a/stack.sh +++ b/stack.sh @@ -89,6 +89,16 @@ DEST=${DEST:-/opt/stack} # Sanity Check # ============ +# We are looking for services with a - at the beginning to force +# excluding those services. For example if you want to install all the default +# services but not nova-volume (n-vol) you can have this set in your localrc : +# ENABLED_SERVICES+=",-n-vol" +for service in ${ENABLED_SERVICES//,/ }; do + if [[ ${service} == -* ]]; then + ENABLED_SERVICES=$(echo ${ENABLED_SERVICES}|sed -r "s/(,)?(-)?${service#-}(,)?/,/g") + fi +done + # Warn users who aren't on an explicitly supported distro, but allow them to # override check and attempt installation with ``FORCE=yes ./stack`` if [[ ! ${DISTRO} =~ (oneiric|precise|quantal|f16) ]]; then diff --git a/stackrc b/stackrc index cc07906d7f..3a19cdb023 100644 --- a/stackrc +++ b/stackrc @@ -6,7 +6,12 @@ RC_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd) # by default you can append them in your ENABLED_SERVICES variable in # your localrc. For example for swift you can just add this in your # localrc to add it with the other services: -# ENABLED_SERVICES="$ENABLED_SERVICES,swift" +# ENABLED_SERVICES+=,swift +# +# If you like to explicitly remove services you can add a -$service in +# ENABLED_SERVICES, for example in your localrc to install all defaults but not +# nova-volume you would just need to set this : +# ENABLED_SERVICES+=,-n-vol ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,n-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,mysql,rabbit # Set the default Nova APIs to enable