Added devstack support for masakari-dashboard

masakari-dashboard will be installed/uninstalled only when
masakari and horizon services are enabled.

Change-Id: I46d33b7fe1f2f4100e1403cf3f6a4ea63990147e
This commit is contained in:
nirajsingh 2018-07-30 12:37:03 +00:00
parent 3104c5f66b
commit cf0d30b8c4
2 changed files with 29 additions and 0 deletions

View File

@ -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

View File

@ -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}