From ee8fa6deca59de3b28b51b9293194b5d5916b4e7 Mon Sep 17 00:00:00 2001 From: Rushil Chugh Date: Thu, 16 Mar 2017 00:42:27 -0400 Subject: [PATCH] Adds Ironic-UI Devstack plugin This change proposes to add Ironic-UI Devstack plugin. Change-Id: Ided8819c2ec9f8fbbbbf1d76a7ec41ae7717288a Closes-Bug: #1663840 --- README.rst | 18 ++++++++++++++++++ devstack/plugin.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++ devstack/settings | 5 +++++ 3 files changed, 69 insertions(+) create mode 100644 devstack/plugin.sh create mode 100644 devstack/settings diff --git a/README.rst b/README.rst index 4d36149b..a9104176 100644 --- a/README.rst +++ b/README.rst @@ -67,6 +67,24 @@ http://docs.openstack.org/developer/horizon/quickstart.html ./run_tests.sh --runserver + + The Ironic Bare Metal Provisioning plugin should now be visible in the Horizon + navigation. + + +Installation Instructions with devstack +--------------------------------------- + +In order to use the Ironic UI with devstack, you will need to enable the UI plugin separately. +This is done in a similar fashion to enabling Ironic for devstack. +Make sure you have horizon enabled (enabled by default in devstack). +Then, enable the Ironic UI plugin appending the following line to the end of the local.conf file, +just after Ironic plugin enablement: + + enable_plugin ironic-ui https://github.com/openstack/ironic-ui + +After this, you can run ./stack.sh from the devstack directory. + The Ironic Bare Metal Provisioning plugin should now be visible in the Horizon navigation. diff --git a/devstack/plugin.sh b/devstack/plugin.sh new file mode 100644 index 00000000..1bbd0a1b --- /dev/null +++ b/devstack/plugin.sh @@ -0,0 +1,46 @@ +# plugin.sh - DevStack plugin.sh dispatch script ironic-ui + +function install_ironic_ui { + # NOTE(crushil): workaround for devstack bug: 1540328 + # where devstack installs 'test-requirements' but should not do it + # for ironic-ui project as it installs Horizon from url. + # Remove following two 'mv' commands when mentioned bug is fixed. + mv $IRONIC_UI_DIR/test-requirements.txt $IRONIC_UI_DIR/_test-requirements.txt + + setup_develop ${IRONIC_UI_DIR} + + mv $IRONIC_UI_DIR/_test-requirements.txt $IRONIC_UI_DIR/test-requirements.txt +} + +# check for service enabled +if is_service_enabled horizon && is_service_enabled ironic && is_service_enabled ironic-ui; then + + if [[ "$1" == "stack" && "$2" == "pre-install" ]]; then + # Set up system services + # no-op + : + elif [[ "$1" == "stack" && "$2" == "install" ]]; then + # Perform installation of service source + echo_summary "Installing Ironic UI" + install_ironic_ui + elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then + # Configure after the other layer 1 and 2 services have been configured + echo_summary "Configuring Ironic UI" + cp -a ${IRONIC_UI_DIR}/ironic_ui/enabled/* ${DEST}/horizon/openstack_dashboard/local/enabled/ + elif [[ "$1" == "stack" && "$2" == "extra" ]]; then + # no-op + : + fi + + if [[ "$1" == "unstack" ]]; then + # no-op + : + fi + + if [[ "$1" == "clean" ]]; then + # Remove state and transient data + # Remember clean.sh first calls unstack.sh + # no-op + : + fi +fi \ No newline at end of file diff --git a/devstack/settings b/devstack/settings new file mode 100644 index 00000000..4347453a --- /dev/null +++ b/devstack/settings @@ -0,0 +1,5 @@ +# settings file for ironic-ui plugin +enable_service ironic-ui + +# set up default directories +IRONIC_UI_DIR=${IRONIC_UI_DIR:=$DEST/ironic-ui} \ No newline at end of file