From 8d863ab27bca2e5234b96e9929202fe547655044 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Tue, 8 Dec 2015 16:13:03 +0900 Subject: [PATCH] devstack plugin for neutron-lbaas-dashboard Change-Id: I7c4ad77d0c078e4a0a25d59226bede82b892bdd1 --- devstack/README.rst | 22 ++++++++++++++++++++++ devstack/plugin.sh | 35 +++++++++++++++++++++++++++++++++++ devstack/settings | 3 +++ 3 files changed, 60 insertions(+) create mode 100644 devstack/README.rst create mode 100644 devstack/plugin.sh create mode 100644 devstack/settings diff --git a/devstack/README.rst b/devstack/README.rst new file mode 100644 index 00000000..36fa0f48 --- /dev/null +++ b/devstack/README.rst @@ -0,0 +1,22 @@ +========================================== +Neutron LBaaS v2 dashboard devstack plugin +========================================== + +This directory contains the neutron-lbaas-dashboard devstack plugin. + +To enable the plugin, add the following to your local.conf: + + enable_plugin neutron-lbaas-dashboard [GITREF] + +where + + is the URL of a neutron-lbaas-dashboard repository + [GITREF] is an optional git ref (branch/ref/tag). The default is master. + +For example: + + enable_plugin neutron-lbaas-dashboard https://git.openstack.org/openstack/neutron-lbaas-dashboard + +Once you enable the plugin in your local.conf, ensure ``horizon`` and +``q-lbaasv2`` services are enabled. If both of them are enabled, +neutron-lbaas-dashboard will be enabled automatically diff --git a/devstack/plugin.sh b/devstack/plugin.sh new file mode 100644 index 00000000..75be2df8 --- /dev/null +++ b/devstack/plugin.sh @@ -0,0 +1,35 @@ +function neutron_lbaas_dashboard_install { + setup_develop $NEUTRON_LBAAS_DASHBOARD_DIR +} + +function neutron_lbaas_dashboard_configure { + cp $NEUTRON_LBAAS_DASHBOARD_ENABLE_FILE \ + $HORIZON_DIR/openstack_dashboard/local/enabled/ +} + +if is_service_enabled horizon && is_service_enabled q-lbaasv2; then + if [[ "$1" == "stack" && "$2" == "install" ]]; then + # Perform installation of service source + echo_summary "Installing neutron-lbaas-dashboard" + neutron_lbaas_dashboard_install + elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then + echo_summary "Configuring neutron-lbaas-dashboard" + neutron_lbaas_dashboard_configure + elif [[ "$1" == "stack" && "$2" == "extra" ]]; then + # Initialize and start the LBaaS service + echo_summary "Initializing neutron-lbaas-dashboard" + fi +fi + +if [[ "$1" == "unstack" ]]; then + # Shut down LBaaS dashboard services + : +fi + +if [[ "$1" == "clean" ]]; then + # Remove state and transient data + # Remember clean.sh first calls unstack.sh + + # Remove lbaas-dashboard enabled file and pyc + rm -f ${NEUTRON_LBAAS_DASHBOARD_ENABLE_FILE}* +fi diff --git a/devstack/settings b/devstack/settings new file mode 100644 index 00000000..d61a8c47 --- /dev/null +++ b/devstack/settings @@ -0,0 +1,3 @@ +NEUTRON_LBAAS_DASHBOARD_DIR=$DEST/neutron-lbaas-dashboard + +NEUTRON_LBAAS_DASHBOARD_ENABLE_FILE=$NEUTRON_LBAAS_DASHBOARD_DIR/neutron_lbaas_dashboard/enabled/_1481_project_ng_loadbalancersv2_panel.py