From de39adcdbeaa8ed8376ca602bd7a2630de3a5ddf Mon Sep 17 00:00:00 2001 From: Mihai Prica Date: Tue, 11 Jun 2013 14:53:44 +0300 Subject: python-quantum: added 2013.1 -Modified the sample configuration files with necessary credentials. -Created initscript for the quantum server. -Configured the openvswitch and linuxbridge plugin agents. Signed-off-by: Mihai Prica --- .../python/python-quantum/fix-amqlib-version.patch | 13 + .../python/python-quantum/linuxbridge_conf.ini | 63 +++++ .../python/python-quantum/ovs_quantum_plugin.ini | 130 ++++++++++ .../python/python-quantum/quantum-agent.init | 70 +++++ .../python/python-quantum/quantum-server.init | 73 ++++++ .../python/python-quantum/quantum.conf | 287 +++++++++++++++++++++ .../python/python-quantum_2013.1.bb | 159 ++++++++++++ 7 files changed, 795 insertions(+) create mode 100644 meta-openstack/recipes-devtools/python/python-quantum/fix-amqlib-version.patch create mode 100644 meta-openstack/recipes-devtools/python/python-quantum/linuxbridge_conf.ini create mode 100644 meta-openstack/recipes-devtools/python/python-quantum/ovs_quantum_plugin.ini create mode 100644 meta-openstack/recipes-devtools/python/python-quantum/quantum-agent.init create mode 100644 meta-openstack/recipes-devtools/python/python-quantum/quantum-server.init create mode 100644 meta-openstack/recipes-devtools/python/python-quantum/quantum.conf create mode 100644 meta-openstack/recipes-devtools/python/python-quantum_2013.1.bb (limited to 'meta-openstack/recipes-devtools/python') diff --git a/meta-openstack/recipes-devtools/python/python-quantum/fix-amqlib-version.patch b/meta-openstack/recipes-devtools/python/python-quantum/fix-amqlib-version.patch new file mode 100644 index 0000000..72aff5e --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-quantum/fix-amqlib-version.patch @@ -0,0 +1,13 @@ +Index: quantum-2013.1.1/tools/pip-requires +=================================================================== +--- quantum-2013.1.1.orig/tools/pip-requires ++++ quantum-2013.1.1/tools/pip-requires +@@ -1,7 +1,7 @@ + Paste + PasteDeploy>=1.5.0 + Routes>=1.12.3 +-amqplib==0.6.1 ++amqplib>=0.6.1 + anyjson>=0.2.4 + argparse + eventlet>=0.9.17 diff --git a/meta-openstack/recipes-devtools/python/python-quantum/linuxbridge_conf.ini b/meta-openstack/recipes-devtools/python/python-quantum/linuxbridge_conf.ini new file mode 100644 index 0000000..476cd3a --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-quantum/linuxbridge_conf.ini @@ -0,0 +1,63 @@ +[VLANS] +# (StrOpt) Type of network to allocate for tenant networks. The +# default value 'local' is useful only for single-box testing and +# provides no connectivity between hosts. You MUST change this to +# 'vlan' and configure network_vlan_ranges below in order for tenant +# networks to provide connectivity between hosts. Set to 'none' to +# disable creation of tenant networks. +# +# Default: tenant_network_type = local +# Example: tenant_network_type = vlan + +# (ListOpt) Comma-separated list of +# [::] tuples enumerating ranges +# of VLAN IDs on named physical networks that are available for +# allocation. All physical networks listed are available for flat and +# VLAN provider network creation. Specified ranges of VLAN IDs are +# available for tenant network allocation if tenant_network_type is +# 'vlan'. If empty, only local networks may be created. +# +# Default: network_vlan_ranges = +# Example: network_vlan_ranges = physnet1:1000:2999 + +[DATABASE] +# This line MUST be changed to actually run the plugin. +# Example: +# sql_connection = mysql://root:nova@127.0.0.1:3306/quantum_linux_bridge +# Replace 127.0.0.1 above with the IP address of the database used by the +# main quantum server. (Leave it as is if the database runs on this host.) +sql_connection = postgresql://nova:nova@localhost/quantum +# Database reconnection retry times - in event connectivity is lost +# set to -1 implies an infinite retry count +# sql_max_retries = 10 +# Database reconnection interval in seconds - if the initial connection to the +# database fails +reconnect_interval = 2 +# Enable the use of eventlet's db_pool for MySQL. The flags sql_min_pool_size, +# sql_max_pool_size and sql_idle_timeout are relevant only if this is enabled. +# sql_dbpool_enable = False +# Minimum number of SQL connections to keep open in a pool +# sql_min_pool_size = 1 +# Maximum number of SQL connections to keep open in a pool +# sql_max_pool_size = 5 +# Timeout in seconds before idle sql connections are reaped +# sql_idle_timeout = 3600 + +[LINUX_BRIDGE] +# (ListOpt) Comma-separated list of +# : tuples mapping physical +# network names to the agent's node-specific physical network +# interfaces to be used for flat and VLAN networks. All physical +# networks listed in network_vlan_ranges on the server should have +# mappings to appropriate interfaces on each agent. +# +# Default: physical_interface_mappings = +# Example: physical_interface_mappings = physnet1:eth1 + +[AGENT] +# Agent's polling interval in seconds +polling_interval = 2 + +[SECURITYGROUP] +# Firewall driver for realizing quantum security group function +firewall_driver = quantum.agent.linux.iptables_firewall.IptablesFirewallDriver diff --git a/meta-openstack/recipes-devtools/python/python-quantum/ovs_quantum_plugin.ini b/meta-openstack/recipes-devtools/python/python-quantum/ovs_quantum_plugin.ini new file mode 100644 index 0000000..ca68814 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-quantum/ovs_quantum_plugin.ini @@ -0,0 +1,130 @@ +[DATABASE] +# This line MUST be changed to actually run the plugin. +# Example: +# sql_connection = mysql://root:nova@127.0.0.1:3306/ovs_quantum +# Replace 127.0.0.1 above with the IP address of the database used by the +# main quantum server. (Leave it as is if the database runs on this host.) +sql_connection = postgresql://nova:nova@localhost/quantum +# Database reconnection retry times - in event connectivity is lost +# set to -1 implies an infinite retry count +# sql_max_retries = 10 +# Database reconnection interval in seconds - if the initial connection to the +# database fails +reconnect_interval = 2 +# Enable the use of eventlet's db_pool for MySQL. The flags sql_min_pool_size, +# sql_max_pool_size and sql_idle_timeout are relevant only if this is enabled. +# sql_dbpool_enable = False +# Minimum number of SQL connections to keep open in a pool +# sql_min_pool_size = 1 +# Maximum number of SQL connections to keep open in a pool +# sql_max_pool_size = 5 +# Timeout in seconds before idle sql connections are reaped +# sql_idle_timeout = 3600 + +[OVS] +# (StrOpt) Type of network to allocate for tenant networks. The +# default value 'local' is useful only for single-box testing and +# provides no connectivity between hosts. You MUST either change this +# to 'vlan' and configure network_vlan_ranges below or change this to +# 'gre' and configure tunnel_id_ranges below in order for tenant +# networks to provide connectivity between hosts. Set to 'none' to +# disable creation of tenant networks. +# +# Default: tenant_network_type = local +# Example: tenant_network_type = gre +tenant_network_type = gre + +# (ListOpt) Comma-separated list of +# [::] tuples enumerating ranges +# of VLAN IDs on named physical networks that are available for +# allocation. All physical networks listed are available for flat and +# VLAN provider network creation. Specified ranges of VLAN IDs are +# available for tenant network allocation if tenant_network_type is +# 'vlan'. If empty, only gre and local networks may be created. +# +# Default: network_vlan_ranges = +# Example: network_vlan_ranges = physnet1:1000:2999 + +# (BoolOpt) Set to True in the server and the agents to enable support +# for GRE networks. Requires kernel support for OVS patch ports and +# GRE tunneling. +# +# Default: enable_tunneling = False +enable_tunneling = True + +# (ListOpt) Comma-separated list of : tuples +# enumerating ranges of GRE tunnel IDs that are available for tenant +# network allocation if tenant_network_type is 'gre'. +# +# Default: tunnel_id_ranges = +# Example: tunnel_id_ranges = 1:1000 +tunnel_id_ranges = 1:1000 + +# Do not change this parameter unless you have a good reason to. +# This is the name of the OVS integration bridge. There is one per hypervisor. +# The integration bridge acts as a virtual "patch bay". All VM VIFs are +# attached to this bridge and then "patched" according to their network +# connectivity. +# +# Default: integration_bridge = br-int + +# Only used for the agent if tunnel_id_ranges (above) is not empty for +# the server. In most cases, the default value should be fine. +# +# Default: tunnel_bridge = br-tun + +# Peer patch port in integration bridge for tunnel bridge +# int_peer_patch_port = patch-tun + +# Peer patch port in tunnel bridge for integration bridge +# tun_peer_patch_port = patch-int + +# Uncomment this line for the agent if tunnel_id_ranges (above) is not +# empty for the server. Set local-ip to be the local IP address of +# this hypervisor. +# +# Default: local_ip = + +# (ListOpt) Comma-separated list of : tuples +# mapping physical network names to the agent's node-specific OVS +# bridge names to be used for flat and VLAN networks. The length of +# bridge names should be no more than 11. Each bridge must +# exist, and should have a physical network interface configured as a +# port. All physical networks listed in network_vlan_ranges on the +# server should have mappings to appropriate bridges on each agent. +# +# Default: bridge_mappings = +# Example: bridge_mappings = physnet1:br-eth1 + +[AGENT] +# Agent's polling interval in seconds +polling_interval = 2 + +[SECURITYGROUP] +# Firewall driver for realizing quantum security group function +# firewall_driver = quantum.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver + +#----------------------------------------------------------------------------- +# Sample Configurations. +#----------------------------------------------------------------------------- +# +# 1. With VLANs on eth1. +# [DATABASE] +# sql_connection = mysql://root:nova@127.0.0.1:3306/ovs_quantum +# [OVS] +# network_vlan_ranges = default:2000:3999 +# tunnel_id_ranges = +# integration_bridge = br-int +# bridge_mappings = default:br-eth1 +# [AGENT] +# Add the following setting, if you want to log to a file +# +# 2. With tunneling. +# [DATABASE] +# sql_connection = mysql://root:nova@127.0.0.1:3306/ovs_quantum +# [OVS] +# network_vlan_ranges = +# tunnel_id_ranges = 1:1000 +# integration_bridge = br-int +# tunnel_bridge = br-tun +# local_ip = 10.0.0.3 diff --git a/meta-openstack/recipes-devtools/python/python-quantum/quantum-agent.init b/meta-openstack/recipes-devtools/python/python-quantum/quantum-agent.init new file mode 100644 index 0000000..1a33d06 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-quantum/quantum-agent.init @@ -0,0 +1,70 @@ +#! /bin/sh + +### BEGIN INIT INFO +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 5 +# Default-Stop: 0 1 6 +# Description: Quantum networking agent +### END INIT INFO + +SUFFIX=@suffix@ +DESC="quantum-$SUFFIX-agent" +DAEMON="/usr/bin/quantum-$SUFFIX-agent" +PIDFILE="/var/run/quantum-$SUFFIX-agent.pid" + +start() +{ + if [ -e $PIDFILE ]; then + PIDDIR=/proc/$(cat $PIDFILE) + if [ -d ${PIDDIR} ]; then + echo "$DESC already running." + exit 1 + else + echo "Removing stale PID file $PIDFILE" + rm -f $PIDFILE + fi + fi + + echo -n "Starting $DESC..." + + start-stop-daemon --start --quiet --background \ + --pidfile ${PIDFILE} --make-pidfile --exec ${DAEMON} + + if [ $? -eq 0 ]; then + echo "done." + else + echo "failed." + fi +} + +stop() +{ + echo -n "Stopping $DESC..." + start-stop-daemon --stop --quiet --pidfile $PIDFILE + if [ $? -eq 0 ]; then + echo "done." + else + echo "failed." + fi + rm -f $PIDFILE +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|force-reload) + stop + start + ;; + *) + echo "Usage: $0 {start|stop|force-reload|restart}" + exit 1 + ;; +esac + +exit 0 diff --git a/meta-openstack/recipes-devtools/python/python-quantum/quantum-server.init b/meta-openstack/recipes-devtools/python/python-quantum/quantum-server.init new file mode 100644 index 0000000..e85bc48 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-quantum/quantum-server.init @@ -0,0 +1,73 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: quantum-server +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 5 +# Default-Stop: 0 1 6 +# Short-Description: quantum-server +# Description: Provides the Quantum networking service +### END INIT INFO + +DESC="quantum-server" +DAEMON="/usr/bin/quantum-server" +PIDFILE="/var/run/quantum-server.pid" +DAEMON_ARGS="--config-file=/etc/quantum/quantum.conf --config-file=@plugin@" + +start() +{ + if [ -e $PIDFILE ]; then + PIDDIR=/proc/$(cat $PIDFILE) + if [ -d ${PIDDIR} ]; then + echo "$DESC already running." + exit 1 + else + echo "Removing stale PID file $PIDFILE" + rm -f $PIDFILE + fi + fi + + echo -n "Starting $DESC..." + + start-stop-daemon --start --quiet --background \ + --pidfile ${PIDFILE} --make-pidfile --exec ${DAEMON} \ + -- $DAEMON_ARGS + + if [ $? -eq 0 ]; then + echo "done." + else + echo "failed." + fi +} + +stop() +{ + echo -n "Stopping $DESC..." + start-stop-daemon --stop --quiet --pidfile $PIDFILE + if [ $? -eq 0 ]; then + echo "done." + else + echo "failed." + fi + rm -f $PIDFILE +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|force-reload) + stop + start + ;; + *) + echo "Usage: $0 {start|stop|force-reload|restart}" + exit 1 + ;; +esac + +exit 0 diff --git a/meta-openstack/recipes-devtools/python/python-quantum/quantum.conf b/meta-openstack/recipes-devtools/python/python-quantum/quantum.conf new file mode 100644 index 0000000..8bb879e --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-quantum/quantum.conf @@ -0,0 +1,287 @@ +[DEFAULT] +# Default log level is INFO +# verbose and debug has the same result. +# One of them will set DEBUG log level output +# debug = False +# verbose = False + +# Where to store Quantum state files. This directory must be writable by the +# user executing the agent. +# state_path = /var/lib/quantum + +# Where to store lock files +lock_path = $state_path/lock + +# log_format = %(asctime)s %(levelname)8s [%(name)s] %(message)s +# log_date_format = %Y-%m-%d %H:%M:%S + +# use_syslog -> syslog +# log_file and log_dir -> log_dir/log_file +# (not log_file) and log_dir -> log_dir/{binary_name}.log +# use_stderr -> stderr +# (not user_stderr) and (not log_file) -> stdout +# publish_errors -> notification system + +# use_syslog = False +# syslog_log_facility = LOG_USER + +# use_stderr = True +# log_file = +# log_dir = + +# publish_errors = False + +# Address to bind the API server +bind_host = 0.0.0.0 + +# Port the bind the API server to +bind_port = 9696 + +# Path to the extensions. Note that this can be a colon-separated list of +# paths. For example: +# api_extensions_path = extensions:/path/to/more/extensions:/even/more/extensions +# The __path__ of quantum.extensions is appended to this, so if your +# extensions are in there you don't need to specify them here +# api_extensions_path = + +# Quantum plugin provider module +core_plugin = quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2 + +# Advanced service modules +# service_plugins = + +# Paste configuration file +api_paste_config = api-paste.ini + +# The strategy to be used for auth. +# Supported values are 'keystone'(default), 'noauth'. +# auth_strategy = keystone + +# Base MAC address. The first 3 octets will remain unchanged. If the +# 4h octet is not 00, it will also used. The others will be +# randomly generated. +# 3 octet +# base_mac = fa:16:3e:00:00:00 +# 4 octet +# base_mac = fa:16:3e:4f:00:00 + +# Maximum amount of retries to generate a unique MAC address +# mac_generation_retries = 16 + +# DHCP Lease duration (in seconds) +# dhcp_lease_duration = 120 + +# Allow sending resource operation notification to DHCP agent +# dhcp_agent_notification = True + +# Enable or disable bulk create/update/delete operations +# allow_bulk = True +# Enable or disable pagination +# allow_pagination = False +# Enable or disable sorting +# allow_sorting = False +# Enable or disable overlapping IPs for subnets +# Attention: the following parameter MUST be set to False if Quantum is +# being used in conjunction with nova security groups and/or metadata service. +# allow_overlapping_ips = False +# Ensure that configured gateway is on subnet +# force_gateway_on_subnet = False + + +# RPC configuration options. Defined in rpc __init__ +# The messaging module to use, defaults to kombu. +# rpc_backend = quantum.openstack.common.rpc.impl_kombu +# Size of RPC thread pool +# rpc_thread_pool_size = 64, +# Size of RPC connection pool +# rpc_conn_pool_size = 30 +# Seconds to wait for a response from call or multicall +# rpc_response_timeout = 60 +# Seconds to wait before a cast expires (TTL). Only supported by impl_zmq. +# rpc_cast_timeout = 30 +# Modules of exceptions that are permitted to be recreated +# upon receiving exception data from an rpc call. +# allowed_rpc_exception_modules = quantum.openstack.common.exception, nova.exception +# AMQP exchange to connect to if using RabbitMQ or QPID +control_exchange = quantum + +# If passed, use a fake RabbitMQ provider +# fake_rabbit = False + +# Configuration options if sending notifications via kombu rpc (these are +# the defaults) +# SSL version to use (valid only if SSL enabled) +# kombu_ssl_version = +# SSL key file (valid only if SSL enabled) +# kombu_ssl_keyfile = +# SSL cert file (valid only if SSL enabled) +# kombu_ssl_certfile = +# SSL certification authority file (valid only if SSL enabled)' +# kombu_ssl_ca_certs = +# IP address of the RabbitMQ installation +# rabbit_host = localhost +# Password of the RabbitMQ server +# rabbit_password = guest +# Port where RabbitMQ server is running/listening +# rabbit_port = 5672 +# RabbitMQ single or HA cluster (host:port pairs i.e: host1:5672, host2:5672) +# rabbit_hosts is defaulted to '$rabbit_host:$rabbit_port' +# rabbit_hosts = localhost:5672 +# User ID used for RabbitMQ connections +# rabbit_userid = guest +# Location of a virtual RabbitMQ installation. +# rabbit_virtual_host = / +# Maximum retries with trying to connect to RabbitMQ +# (the default of 0 implies an infinite retry count) +# rabbit_max_retries = 0 +# RabbitMQ connection retry interval +# rabbit_retry_interval = 1 +# Use HA queues in RabbitMQ (x-ha-policy: all).You need to +# wipe RabbitMQ database when changing this option. (boolean value) +# rabbit_ha_queues = false + +# QPID +rpc_backend=quantum.openstack.common.rpc.impl_qpid +# Qpid broker hostname +qpid_hostname = localhost +# Qpid broker port +qpid_port = 5672 +# Qpid single or HA cluster (host:port pairs i.e: host1:5672, host2:5672) +# qpid_hosts is defaulted to '$qpid_hostname:$qpid_port' +# qpid_hosts = localhost:5672 +# Username for qpid connection +# qpid_username = '' +# Password for qpid connection +# qpid_password = '' +# Space separated list of SASL mechanisms to use for auth +# qpid_sasl_mechanisms = '' +# Seconds between connection keepalive heartbeats +# qpid_heartbeat = 60 +# Transport to use, either 'tcp' or 'ssl' +# qpid_protocol = tcp +# Disable Nagle algorithm +# qpid_tcp_nodelay = True + +# ZMQ +# rpc_backend=quantum.openstack.common.rpc.impl_zmq +# ZeroMQ bind address. Should be a wildcard (*), an ethernet interface, or IP. +# The "host" option should point or resolve to this address. +# rpc_zmq_bind_address = * + +# ============ Notification System Options ===================== + +# Notifications can be sent when network/subnet/port are create, updated or deleted. +# There are three methods of sending notifications: logging (via the +# log_file directive), rpc (via a message queue) and +# noop (no notifications sent, the default) + +# Notification_driver can be defined multiple times +# Do nothing driver +# notification_driver = quantum.openstack.common.notifier.no_op_notifier +# Logging driver +# notification_driver = quantum.openstack.common.notifier.log_notifier +# RPC driver. DHCP agents needs it. +notification_driver = quantum.openstack.common.notifier.rpc_notifier + +# default_notification_level is used to form actual topic name(s) or to set logging level +default_notification_level = INFO + +# default_publisher_id is a part of the notification payload +# host = myhost.com +# default_publisher_id = $host + +# Defined in rpc_notifier, can be comma separated values. +# The actual topic names will be %s.%(default_notification_level)s +notification_topics = notifications + +# Default maximum number of items returned in a single response, +# value == infinite and value < 0 means no max limit, and value must +# greater than 0. If the number of items requested is greater than +# pagination_max_limit, server will just return pagination_max_limit +# of number of items. +# pagination_max_limit = -1 + +# Maximum number of DNS nameservers per subnet +# max_dns_nameservers = 5 + +# Maximum number of host routes per subnet +# max_subnet_host_routes = 20 + +# Maximum number of fixed ips per port +# max_fixed_ips_per_port = 5 + +# =========== items for agent management extension ============= +# Seconds to regard the agent as down. +# agent_down_time = 5 +# =========== end of items for agent management extension ===== + +# =========== items for agent scheduler extension ============= +# Driver to use for scheduling network to DHCP agent +# network_scheduler_driver = quantum.scheduler.dhcp_agent_scheduler.ChanceScheduler +# Driver to use for scheduling router to a default L3 agent +# router_scheduler_driver = quantum.scheduler.l3_agent_scheduler.ChanceScheduler + +# Allow auto scheduling networks to DHCP agent. It will schedule non-hosted +# networks to first DHCP agent which sends get_active_networks message to +# quantum server +# network_auto_schedule = True + +# Allow auto scheduling routers to L3 agent. It will schedule non-hosted +# routers to first L3 agent which sends sync_routers message to quantum server +# router_auto_schedule = True +# =========== end of items for agent scheduler extension ===== + +[QUOTAS] +# resource name(s) that are supported in quota features +# quota_items = network,subnet,port + +# default number of resource allowed per tenant, minus for unlimited +# default_quota = -1 + +# number of networks allowed per tenant, and minus means unlimited +# quota_network = 10 + +# number of subnets allowed per tenant, and minus means unlimited +# quota_subnet = 10 + +# number of ports allowed per tenant, and minus means unlimited +# quota_port = 50 + +# number of security groups allowed per tenant, and minus means unlimited +# quota_security_group = 10 + +# number of security group rules allowed per tenant, and minus means unlimited +# quota_security_group_rule = 100 + +# default driver to use for quota checks +# quota_driver = quantum.quota.ConfDriver + +[DEFAULT_SERVICETYPE] +# Description of the default service type (optional) +# description = "default service type" +# Enter a service definition line for each advanced service provided +# by the default service type. +# Each service definition should be in the following format: +# :[:driver] + +[AGENT] +# Use "sudo quantum-rootwrap /etc/quantum/rootwrap.conf" to use the real +# root filter facility. +# Change to "sudo" to skip the filtering and just run the comand directly +# root_helper = sudo + +# =========== items for agent management extension ============= +# seconds between nodes reporting state to server, should be less than +# agent_down_time +# report_interval = 4 + +# =========== end of items for agent management extension ===== + +[keystone_authtoken] +auth_host = 127.0.0.1 +auth_port = 35357 +auth_protocol = http +admin_tenant_name = service +admin_user = admin +admin_password = password +signing_dir = /var/lib/quantum/keystone-signing diff --git a/meta-openstack/recipes-devtools/python/python-quantum_2013.1.bb b/meta-openstack/recipes-devtools/python/python-quantum_2013.1.bb new file mode 100644 index 0000000..f17b01e --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-quantum_2013.1.bb @@ -0,0 +1,159 @@ +DESCRIPTION = "Quantum (virtual network service)" +HOMEPAGE = "https://launchpad.net/quantum" +SECTION = "devel/python" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=1dece7821bf3fd70fe1309eaa37d52a2" + +PR = "r0" +SRCNAME = "quantum" + +SRC_URI = "https://launchpad.net/${SRCNAME}/grizzly/${PV}/+download/${SRCNAME}-${PV}.tar.gz \ + file://fix-amqlib-version.patch \ + file://quantum.conf \ + file://ovs_quantum_plugin.ini \ + file://linuxbridge_conf.ini \ + file://quantum-server.init \ + file://quantum-agent.init \ + " + +#SRC_URI[md5sum] = "06ba502f288e30519f2f13c7b189bfb8" +#SRC_URI[sha256sum] = "1fa925e2d95b7c508ad826d3020d67e1f720efa53e5c41eaca790116f2a0f691" + +SRC_URI[md5sum] = "1ad2338b25cfde582de479678533113e" +SRC_URI[sha256sum] = "edae19fe45849168bc9cace82b63a11a3b9d2292ba733d4c536657c1c722e61e" + +S = "${WORKDIR}/${SRCNAME}-${PV}" + +inherit setuptools update-rc.d + +do_install_append() { + + QUANTUM_CONF_DIR=${D}${sysconfdir}/quantum + + install -d ${QUANTUM_CONF_DIR} + install -d ${QUANTUM_CONF_DIR}/plugins/openvswitch + install -d ${QUANTUM_CONF_DIR}/plugins/linuxbridge + + install -m 600 ${WORKDIR}/quantum.conf ${QUANTUM_CONF_DIR}/ + install -m 600 ${WORKDIR}/ovs_quantum_plugin.ini ${QUANTUM_CONF_DIR}/plugins/openvswitch/ + install -m 600 ${WORKDIR}/linuxbridge_conf.ini ${QUANTUM_CONF_DIR}/plugins/linuxbridge/ + install -m 600 ${S}/etc/api-paste.ini ${QUANTUM_CONF_DIR}/ + install -m 600 ${S}/etc/policy.json ${QUANTUM_CONF_DIR}/ + + PLUGIN=openvswitch + + if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then + install -d ${D}${sysconfdir}/init.d + sed "s:@plugin@:/etc/quantum/plugins/$PLUGIN/ovs_quantum_plugin.ini:" \ + < ${WORKDIR}/quantum-server.init >${WORKDIR}/quantum-server.init.sh + install -m 0755 ${WORKDIR}/quantum-server.init.sh ${D}${sysconfdir}/init.d/quantum-server + sed "s:@suffix@:$PLUGIN:" < ${WORKDIR}/quantum-agent.init >${WORKDIR}/quantum-$PLUGIN.init.sh + install -m 0755 ${WORKDIR}/quantum-$PLUGIN.init.sh ${D}${sysconfdir}/init.d/quantum-$PLUGIN-agent + fi +} + +pkg_postinst_${SRCNAME} () { + if [ "x$D" != "x" ]; then + exit 1 + fi + + # quick fix + #exit 1 + sudo -u postgres createdb quantum +} + +PACKAGES += " \ + ${SRCNAME} \ + ${SRCNAME}-doc \ + ${SRCNAME}-server \ + ${SRCNAME}-plugin-openvswitch \ + ${SRCNAME}-plugin-linuxbridge \ + ${SRCNAME}-dhcp-agent \ + ${SRCNAME}-l3-agent \ + ${SRCNAME}-metadata-agent \ + ${SRCNAME}-extra-agents \ + " + +FILES_${PN} = "${libdir}/*" + +FILES_${SRCNAME} = " \ + ${bindir}/quantum-db-manage \ + ${bindir}/quantum-rootwrap \ + ${bindir}/quantum-debug \ + ${bindir}/quantum-netns-cleanup \ + ${bindir}/quantum-ovs-cleanup \ + ${sysconfdir}/${SRCNAME}/* " + +FILES_${SRCNAME}-server = "${bindir}/quantum-server \ + ${sysconfdir}/init.d/quantum-server \ + " + +FILES_${SRCNAME}-plugin-openvswitch = " \ + ${bindir}/quantum-openvswitch-agent \ + ${sysconfdir}/${SRCNAME}/plugins/openvswitch/ovs_quantum_plugin.ini \ + ${sysconfdir}/init.d/quantum-openvswitch-agent \ + " + +FILES_${SRCNAME}-plugin-linuxbridge = " \ + ${bindir}/quantum-linuxbridge-agent \ + ${sysconfdir}/${SRCNAME}/plugins/linuxbridge/linuxbridge_conf.ini \ + ${sysconfdir}/init.d/quantum-linuxbridge-agent \ + " + +FILES_${SRCNAME}-dhcp-agent = "${bindir}/quantum-dhcp-agent \ + ${sysconfdir}/${SRCNAME}/dhcp_agent.ini \ + ${sysconfdir}/init.d/dhcp_agent \ + " + +FILES_${SRCNAME}-l3-agent = "${bindir}/quantum-l3-agent \ + ${sysconfdir}/${SRCNAME}/l3_agent.ini \ + ${sysconfdir}/init.d/l3_agent \ + " + +FILES_${SRCNAME}-metadata-agent = "${bindir}/quantum-metadata-agent \ + ${sysconfdir}/${SRCNAME}/metadata_agent.ini \ + ${sysconfdir}/init.d/metadata_agent \ + " + +FILES_${SRCNAME}-extra-agents = "${bindir}/*" + +FILES_${SRCNAME}-doc = "${datadir}/*" + +RDEPENDS_${PN} += "python-paste \ + python-pastedeploy \ + python-routes \ + python-amqplib \ + python-anyjson \ + python-alembic \ + python-eventlet \ + python-greenlet \ + python-httplib2 \ + python-iso8601 \ + python-kombu \ + python-netaddr \ + python-quantumclient \ + python-sqlalchemy \ + python-webob \ + python-keystoneclient \ + python-oslo.config \ + python-pyudev \ + python-novaclient \ + python-mako \ + python-markupsafe \ + " + +RDEPENDS_${SRCNAME} = "${PN} \ + postgresql postgresql-client python-psycopg2" + +RDEPENDS_${SRCNAME}-server = "${SRCNAME}" +RDEPENDS_${SRCNAME}-plugin-openvswitch = "${SRCNAME} openvswitch-switch " +RDEPENDS_${SRCNAME}-plugin-linuxbridge = "${SRCNAME} bridge-utils" +RDEPENDS_${SRCNAME}-dhcp-agent = "${SRCNAME} dnsmasq" +RDEPENDS_${SRCNAME}-l3-agent = "${SRCNAME} ${SRCNAME}-metadata-agent iputils" + +RRECOMMENDS_${SRCNAME}-server = "${SRCNAME}-plugin-openvswitch" + +INITSCRIPT_PACKAGES = "${SRCNAME}-server ${SRCNAME}-plugin-openvswitch ${SRCNAME}-plugin-linuxbridge" +INITSCRIPT_NAME_${SRCNAME}-server = "quantum-server" +INITSCRIPT_NAME_${SRCNAME}-plugin-openvswitch = "quantum-openvswitch-agent" +INITSCRIPT_NAME_${SRCNAME}-plugin-linuxbridge = "quantum-linuxbridge-agent" -- cgit v1.2.3-54-g00ecf