From cf0d30b8c40ccc6ea61b4e2077d4a15ab0eb79d9 Mon Sep 17 00:00:00 2001 From: nirajsingh Date: Mon, 30 Jul 2018 12:37:03 +0000 Subject: [PATCH] Added devstack support for masakari-dashboard masakari-dashboard will be installed/uninstalled only when masakari and horizon services are enabled. Change-Id: I46d33b7fe1f2f4100e1403cf3f6a4ea63990147e --- devstack/plugin.sh | 26 ++++++++++++++++++++++++++ devstack/settings | 3 +++ 2 files changed, 29 insertions(+) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index abf94a26..f7aab3d7 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -200,6 +200,23 @@ function start_masakari { run_process masakari-engine "$MASAKARI_BIN_DIR/masakari-engine --config-file=$MASAKARI_CONF --debug" } +#install masakari-dashboard +function install_masakaridashboard { + git_clone $MASAKARI_DASHBOARD_REPO $MASAKARI_DASHBOARD_DIR $MASAKARI_DASHBOARD_BRANCH + setup_develop $MASAKARI_DASHBOARD_DIR + ln -fs $MASAKARI_DASHBOARD_DIR/masakaridashboard/local/enabled/_50_masakaridashboard.py $HORIZON_DIR/openstack_dashboard/local/enabled + ln -fs $MASAKARI_DASHBOARD_DIR/masakaridashboard/local/local_settings.d/_50_masakari.py $HORIZON_DIR/openstack_dashboard/local/local_settings.d + ln -fs $MASAKARI_DASHBOARD_DIR/masakaridashboard/conf/masakari_policy.json $HORIZON_DIR/openstack_dashboard/conf +} + +#uninstall masakari-dashboard +function uninstall_masakaridashboard { + sudo rm -f $DEST/horizon/openstack_dashboard/local/enabled/_50_masakaridashboard.py + sudo rm -f $DEST/horizon/openstack_dashboard/local/local_settings.d/_50_masakari.py + sudo rm -f $DEST/horizon/penstack_dashboard/conf/masakari_policy.json + restart_apache_server +} + # stop_masakari() - Stop running processes function stop_masakari { # Kill the masakari services @@ -229,9 +246,18 @@ if is_service_enabled masakari; then # Start the masakari API and masakari taskmgr components echo_summary "Starting Masakari" start_masakari + if is_service_enabled horizon; then + # install masakari-dashboard + echo_summary "Installing masakari-dashboard" + install_masakaridashboard + fi fi if [[ "$1" == "unstack" ]]; then + if is_service_enabled horizon; then + echo_summary "Uninstall masakari-dashboard" + uninstall_masakaridashboard + fi stop_masakari cleanup_masakari fi diff --git a/devstack/settings b/devstack/settings index 1f761f34..c6cb1380 100644 --- a/devstack/settings +++ b/devstack/settings @@ -5,9 +5,12 @@ MASAKARI_DIR=${MASAKARI_DIR:-${DEST}/masakari} MASAKARI_REPO=${GIT_BASE}/openstack/masakari.git} MASAKARI_BRANCH=${MASAKARI_BRANCH:-master} +MASAKARI_DASHBOARD_REPO=${MASAKARI_DASHBOARD_REPO:-${GIT_BASE}/openstack/masakari-dashboard.git} +MASAKARI_DASHBOARD_BRANCH=${MASAKARI_DASHBOARD_BRANCH:-master} # Set up configuration directory and files MASAKARI_CONF_DIR=${MASAKARI_CONF_DIR:-/etc/masakari} +MASAKARI_DASHBOARD_DIR=$DEST/masakari-dashboard MASAKARI_CONF=${MASAKARI_CONF:-${MASAKARI_CONF_DIR}/masakari.conf} MASAKARI_API_PASTE_INI=${MASAKARI_API_PASTE_INI:-${MASAKARI_CONF_DIR}/api-paste.ini} MASAKARI_POLICY_JSON=${MASAKARI_POLICY_JSON:-${MASAKARI_CONF_DIR}/policy.json}