From 1768e94b9e600884d43e65b3ef05e379f043a196 Mon Sep 17 00:00:00 2001 From: Mark Asselstine Date: Sat, 22 Mar 2014 23:20:07 -0400 Subject: python-neutron: get the l3-agent properly packaged The recipe had the initial groundwork established to create the l3-agent package but some aspects were incomplete. Add the necessary .ini file and create the initscript necessary to launch the l3-agent at boot time. Signed-off-by: Mark Asselstine --- .../python/python-neutron/l3_agent.ini | 65 ++++++++++++++++++++++ .../python/python-neutron/neutron-agent.init | 3 +- .../recipes-devtools/python/python-neutron_git.bb | 18 +++++- 3 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 meta-openstack/recipes-devtools/python/python-neutron/l3_agent.ini (limited to 'meta-openstack/recipes-devtools') diff --git a/meta-openstack/recipes-devtools/python/python-neutron/l3_agent.ini b/meta-openstack/recipes-devtools/python/python-neutron/l3_agent.ini new file mode 100644 index 0000000..1310c7e --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-neutron/l3_agent.ini @@ -0,0 +1,65 @@ +[DEFAULT] +# Show debugging output in log (sets DEBUG log level output) +# debug = False + +# L3 requires that an interface driver be set. Choose the one that best +# matches your plugin. +# interface_driver = + +# Example of interface_driver option for OVS based plugins (OVS, Ryu, NEC) +# that supports L3 agent +interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver + +# Use veth for an OVS interface or not. +# Support kernels with limited namespace support +# (e.g. RHEL 6.5) so long as ovs_use_veth is set to True. +# ovs_use_veth = False + +# Example of interface_driver option for LinuxBridge +# interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver + +# Allow overlapping IP (Must have kernel build with CONFIG_NET_NS=y and +# iproute2 package that supports namespaces). +# use_namespaces = True + +# If use_namespaces is set as False then the agent can only configure one router. + +# This is done by setting the specific router_id. +# router_id = + +# Each L3 agent can be associated with at most one external network. This +# value should be set to the UUID of that external network. If empty, +# the agent will enforce that only a single external networks exists and +# use that external network id +# gateway_external_network_id = + +# Indicates that this L3 agent should also handle routers that do not have +# an external network gateway configured. This option should be True only +# for a single agent in a Neutron deployment, and may be False for all agents +# if all routers must have an external network gateway +# handle_internal_only_routers = True + +# Name of bridge used for external network traffic. This should be set to +# empty value for the linux bridge +# external_network_bridge = br-ex + +# TCP Port used by Neutron metadata server +# metadata_port = 9697 + +# Send this many gratuitous ARPs for HA setup. Set it below or equal to 0 +# to disable this feature. +# send_arp_for_ha = 3 + +# seconds between re-sync routers' data if needed +# periodic_interval = 40 + +# seconds to start to sync routers' data after +# starting agent +# periodic_fuzzy_delay = 5 + +# enable_metadata_proxy, which is true by default, can be set to False +# if the Nova metadata server is not available +# enable_metadata_proxy = True + +# Location of Metadata Proxy UNIX domain socket +# metadata_proxy_socket = $state_path/metadata_proxy diff --git a/meta-openstack/recipes-devtools/python/python-neutron/neutron-agent.init b/meta-openstack/recipes-devtools/python/python-neutron/neutron-agent.init index 01cb27e..8bd4c23 100644 --- a/meta-openstack/recipes-devtools/python/python-neutron/neutron-agent.init +++ b/meta-openstack/recipes-devtools/python/python-neutron/neutron-agent.init @@ -12,6 +12,7 @@ SUFFIX=@suffix@ DESC="neutron-$SUFFIX-agent" DAEMON="/usr/bin/neutron-$SUFFIX-agent" PIDFILE="/var/run/neutron-$SUFFIX-agent.pid" +DAEMON_ARGS="@args@" start() { @@ -34,7 +35,7 @@ start() start-stop-daemon --start --quiet --background \ --pidfile ${PIDFILE} --make-pidfile --exec ${DAEMON} \ - -- --log-dir=/var/log/neutron + -- ${DAEMON_ARGS} --log-dir=/var/log/neutron if [ $? -eq 0 ]; then echo "done." diff --git a/meta-openstack/recipes-devtools/python/python-neutron_git.bb b/meta-openstack/recipes-devtools/python/python-neutron_git.bb index fcb8b4d..b256c79 100644 --- a/meta-openstack/recipes-devtools/python/python-neutron_git.bb +++ b/meta-openstack/recipes-devtools/python/python-neutron_git.bb @@ -12,6 +12,7 @@ SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/havana \ file://linuxbridge_conf.ini \ file://neutron-server.init \ file://neutron-agent.init \ + file://l3_agent.ini \ " SRCREV="8cb9d895675f2a89c6b741da4b594f416fbeee5a" PV="2013.2.2+git${SRCPV}" @@ -53,15 +54,24 @@ do_install_append() { install -m 600 ${S}/etc/policy.json ${NEUTRON_CONF_DIR}/ PLUGIN=openvswitch + ARGS="" if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then install -d ${D}${sysconfdir}/init.d sed "s:@plugin@:/etc/neutron/plugins/$PLUGIN/ovs_neutron_plugin.ini:" \ < ${WORKDIR}/neutron-server.init >${WORKDIR}/neutron-server.init.sh install -m 0755 ${WORKDIR}/neutron-server.init.sh ${D}${sysconfdir}/init.d/neutron-server - sed "s:@suffix@:$PLUGIN:" < ${WORKDIR}/neutron-agent.init >${WORKDIR}/neutron-$PLUGIN.init.sh + sed "s:@suffix@:$PLUGIN:;s:@args@:$ARGS:" < ${WORKDIR}/neutron-agent.init >${WORKDIR}/neutron-$PLUGIN.init.sh install -m 0755 ${WORKDIR}/neutron-$PLUGIN.init.sh ${D}${sysconfdir}/init.d/neutron-$PLUGIN-agent fi + AGENT=l3 + ARGS="--config-file=${sysconfdir}/${SRCNAME}/neutron.conf --config-file=${sysconfdir}/${SRCNAME}/l3_agent.ini" + if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then + sed "s:@suffix@:$AGENT:;s:@args@:$ARGS:" < ${WORKDIR}/neutron-agent.init >${WORKDIR}/neutron-$AGENT.init.sh + install -m 0755 ${WORKDIR}/neutron-$AGENT.init.sh ${D}${sysconfdir}/init.d/neutron-$AGENT-agent + install -m 600 ${WORKDIR}/${AGENT}_agent.ini ${NEUTRON_CONF_DIR}/ + fi + cp run_tests.sh ${NEUTRON_CONF_DIR} } @@ -147,7 +157,7 @@ FILES_${SRCNAME}-dhcp-agent = "${bindir}/neutron-dhcp-agent \ FILES_${SRCNAME}-l3-agent = "${bindir}/neutron-l3-agent \ ${sysconfdir}/${SRCNAME}/l3_agent.ini \ - ${sysconfdir}/init.d/l3_agent \ + ${sysconfdir}/init.d/neutron-l3-agent \ " FILES_${SRCNAME}-metadata-agent = "${bindir}/neutron-metadata-agent \ @@ -202,10 +212,12 @@ RDEPENDS_${SRCNAME}-setup = "postgresql sudo" RRECOMMENDS_${SRCNAME}-server = "${SRCNAME}-plugin-openvswitch" -INITSCRIPT_PACKAGES = "${SRCNAME}-server ${SRCNAME}-plugin-openvswitch ${SRCNAME}-plugin-linuxbridge" +INITSCRIPT_PACKAGES = "${SRCNAME}-server ${SRCNAME}-plugin-openvswitch ${SRCNAME}-plugin-linuxbridge ${SRCNAME}-l3-agent" INITSCRIPT_NAME_${SRCNAME}-server = "neutron-server" INITSCRIPT_PARAMS_${SRCNAME}-server = "${OS_DEFAULT_INITSCRIPT_PARAMS}" INITSCRIPT_NAME_${SRCNAME}-plugin-openvswitch = "neutron-openvswitch-agent" INITSCRIPT_PARAMS_${SRCNAME}-plugin-openvswitch = "${OS_DEFAULT_INITSCRIPT_PARAMS}" INITSCRIPT_NAME_${SRCNAME}-plugin-linuxbridge = "neutron-linuxbridge-agent" INITSCRIPT_PARAMS_${SRCNAME}-plugin-linuxbridge = "${OS_DEFAULT_INITSCRIPT_PARAMS}" +INITSCRIPT_NAME_${SRCNAME}-l3-agent = "neutron-l3-agent" +INITSCRIPT_PARAMS_${SRCNAME}-l3-agent = "${OS_DEFAULT_INITSCRIPT_PARAMS}" -- cgit v1.2.3-54-g00ecf