Add pluggable devstack for networking-l2gw

Add plugin.sh script to enable l2gw plugin and agent

Change-Id: I013c50dfc7aee833a0809affde1910617019e130
stable/ocata
Alok Maurya 8 years ago committed by armando-migliaccio
parent 8abc61dd36
commit 4d022e08be
  1. 17
      devstack/README.rst
  2. 82
      devstack/plugin.sh
  3. 15
      devstack/settings

@ -0,0 +1,17 @@
======================
Enabling in Devstack
======================
1. Download DevStack
2. Add this repo as an external repository:
> cat local.conf
[[local|localrc]]
enable_plugin networking-l2gw https://github.com/stackforge/networking-l2gw
enable_service l2gw-plugin l2gw-agent
OVSDB_HOSTS=<ovsdb_name>:<ip address>:<port>
3. run ``stack.sh``

@ -0,0 +1,82 @@
#!/bin/bash
# devstack/plugin.sh
# Functions to control the configuration and operation of the l2gw
# Dependencies:
#
# ``functions`` file
# ``DEST`` must be defined
# ``STACK_USER`` must be defined
# ``stack.sh`` calls the entry points in this order:
# Save trace setting
XTRACE=$(set +o | grep xtrace)
set +o xtrace
function install_l2gw {
setup_develop $L2GW_DIR
}
function configure_agent_conf {
cp $L2GW_DIR/etc/l2gateway_agent.ini $L2GW_CONF_FILE
iniset $L2GW_CONF_FILE ovsdb ovsdb_hosts $OVSDB_HOSTS
}
function start_l2gw_agent {
run_process l2gw-agent "python $L2GW_AGENT_BINARY --config-file $NEUTRON_CONF --config-file=$L2GW_CONF_FILE"
}
function configure_l2gw_plugin {
_neutron_service_plugin_class_add $L2GW_PLUGIN
}
# main loop
if is_service_enabled l2gw-plugin; then
if [[ "$1" == "source" ]]; then
# no-op
:
elif [[ "$1" == "stack" && "$2" == "install" ]]; then
install_l2gw
configure_l2gw_plugin
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
#no-op
:
elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then
# no-op
:
fi
if [[ "$1" == "unstack" ]]; then
# no-op
:
fi
if [[ "$1" == "clean" ]]; then
# no-op
:
fi
fi
if is_service_enabled l2gw-agent; then
if [[ "$1" == "source" ]]; then
# no-op
:
elif [[ "$1" == "stack" && "$2" == "install" ]]; then
install_l2gw
configure_agent_conf
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
start_l2gw_agent
fi
if [[ "$1" == "unstack" ]]; then
#no-op
:
fi
if [[ "$1" == "clean" ]]; then
#no-op
:
fi
fi
# Restore xtrace
$XTRACE

@ -0,0 +1,15 @@
# Devstack settings
L2GW_DIR=$DEST/networking-l2gw
L2GW_AGENT_BINARY="$NEUTRON_BIN_DIR/neutron-l2gateway-agent"
L2GW_PLUGIN=${L2GW_PLUGIN:-"networking_l2gw.services.l2gateway.plugin.L2GatewayPlugin"}
L2GW_CONF_FILE=/etc/neutron/l2gateway_agent.ini
#
# Each service you enable has the following meaning:
# l2gw-plugin - Add this config flag to enable l2gw service plugin
# l2gw-agent - Add this config flag to enable l2gw agent
#
# An example of enabling all-in-one l2gw is below.
# enable_service l2gw-plugin l2gw-agent
#
# This can be overridden in the localrc file
OVSDB_HOSTS=${OVSDB_HOSTS:-"ovsdb1:127.0.0.1:6632"}
Loading…
Cancel
Save