]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
vstart: allow disabling dashboard with option 20986/head
authorJoao Eduardo Luis <joao@suse.de>
Wed, 21 Mar 2018 09:13:47 +0000 (09:13 +0000)
committerJoao Eduardo Luis <joao@suse.de>
Thu, 22 Mar 2018 02:59:24 +0000 (02:59 +0000)
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
src/vstart.sh

index ead8ecba440267868bed65add11609349b084835..1e8aea2bcd4c8ba328da322f305fc631e7184410 100755 (executable)
@@ -130,6 +130,12 @@ rgw_frontend="civetweb"
 rgw_compression=""
 lockdep=${LOCKDEP:-1}
 
+with_mgr_dashboard=true
+if [[ "$(get_cmake_variable WITH_MGR_DASHBOARD_FRONTEND)" != "ON" ]]; then
+  echo "ceph-mgr dashboard not built - disabling."
+  with_mgr_dashboard=false
+fi
+
 filestore_path=
 
 VSTART_SEC="client.vstart.sh"
@@ -171,6 +177,7 @@ usage=$usage"\t--cache <pool>: enable cache tiering on pool\n"
 usage=$usage"\t--short: short object names only; necessary for ext4 dev\n"
 usage=$usage"\t--nolockdep disable lockdep\n"
 usage=$usage"\t--multimds <count> allow multimds with maximum active count\n"
+usage=$usage"\t--without-dashboard: do not run using mgr dashboard"
 
 usage_exit() {
        printf "$usage"
@@ -313,6 +320,9 @@ case $1 in
         CEPH_MAX_MDS="$2"
         shift
         ;;
+    --without-dashboard)
+        with_mgr_dashboard=false
+        ;;
     * )
            usage_exit
 esac
@@ -410,6 +420,11 @@ prepare_conf() {
         heartbeat file = $CEPH_OUT_DIR/\$name.heartbeat
 "
 
+    local mgr_modules="restful status balancer"
+    if $with_mgr_dashboard; then
+      mgr_modules="dashboard $mgr_modules"
+    fi
+
     wconf <<EOF
 ; generated by vstart.sh on `date`
 [$VSTART_SEC]
@@ -502,7 +517,7 @@ $DAEMONOPTS
 $COSDSHORT
 $extra_conf
 [mon]
-        mgr initial modules = dashboard restful status balancer
+        mgr initial modules = $mgr_modules
 $DAEMONOPTS
 $CMONDEBUG
 $extra_conf
@@ -648,11 +663,13 @@ start_mgr() {
         host = $HOSTNAME
 EOF
 
-       ceph_adm config-key set mgr/dashboard/$name/server_port $MGR_PORT
-        if [ $mgr -eq 1 ]; then
-            DASH_URLS="http://$IP:$MGR_PORT"
-        else
-            DASH_URLS+=", http://$IP:$MGR_PORT"
+        if $with_mgr_dashboard ; then
+            ceph_adm config-key set mgr/dashboard/$name/server_port $MGR_PORT
+            if [ $mgr -eq 1 ]; then
+                DASH_URLS="http://$IP:$MGR_PORT"
+            else
+                DASH_URLS+=", http://$IP:$MGR_PORT"
+            fi
         fi
        MGR_PORT=$(($MGR_PORT + 1000))
 
@@ -672,7 +689,9 @@ EOF
     # to register the python module commands.
 
     # setting login credentials for dashboard
-    ceph_adm tell mgr dashboard set-login-credentials admin admin
+    if $with_mgr_dashboard; then
+        ceph_adm tell mgr dashboard set-login-credentials admin admin
+    fi
 
     if ceph_adm tell mgr restful create-self-signed-cert; then
         SF=`mktemp`
@@ -1058,8 +1077,10 @@ fi
 echo "started.  stop.sh to stop.  see out/* (e.g. 'tail -f out/????') for debug output."
 
 echo ""
-echo "dashboard urls: $DASH_URLS"
-echo "  w/ user/pass: admin / admin"
+if $with_mgr_dashboard; then
+    echo "dashboard urls: $DASH_URLS"
+    echo "  w/ user/pass: admin / admin"
+fi
 echo "restful urls: $RESTFUL_URLS"
 echo "  w/ user/pass: admin / $RESTFUL_SECRET"
 echo ""