From d25f89ad1217dc1a4722452cf280b5859966041e Mon Sep 17 00:00:00 2001 From: Tim Miller Date: Wed, 12 Dec 2012 15:25:46 -0800 Subject: [PATCH] Install quantum-api from github. Change-Id: If7ae61bce1ee263077ecd3e49beab4e5c8f97cf2 --- elements/quantum-api/README.md | 2 ++ .../quantum-api/first-boot.d/05-quantum-api | 7 ++++ .../first-boot.d/etc_init_quantum-api.conf | 23 +++++++++++++ elements/quantum-api/install.d/05-quantum-api | 34 +++++++++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 elements/quantum-api/README.md create mode 100755 elements/quantum-api/first-boot.d/05-quantum-api create mode 100644 elements/quantum-api/first-boot.d/etc_init_quantum-api.conf create mode 100755 elements/quantum-api/install.d/05-quantum-api diff --git a/elements/quantum-api/README.md b/elements/quantum-api/README.md new file mode 100644 index 00000000..35716d1f --- /dev/null +++ b/elements/quantum-api/README.md @@ -0,0 +1,2 @@ +Installs Quantum API service from github. + diff --git a/elements/quantum-api/first-boot.d/05-quantum-api b/elements/quantum-api/first-boot.d/05-quantum-api new file mode 100755 index 00000000..07f1b556 --- /dev/null +++ b/elements/quantum-api/first-boot.d/05-quantum-api @@ -0,0 +1,7 @@ +#!/bin/bash +set -e +set -o xtrace + +# upstart script +cp -f $(dirname $0)/etc_init_quantum-api.conf /etc/init/quantum-api.conf + diff --git a/elements/quantum-api/first-boot.d/etc_init_quantum-api.conf b/elements/quantum-api/first-boot.d/etc_init_quantum-api.conf new file mode 100644 index 00000000..edd18f77 --- /dev/null +++ b/elements/quantum-api/first-boot.d/etc_init_quantum-api.conf @@ -0,0 +1,23 @@ +description "OpenStack Quantum service" + +# TODO: see if this can be consumed from upstream packaging, instead of being repeated here. + +start on (local-filesystems and net-device-up IFACE!=lo) +stop on runlevel [016] + +respawn + +pre-start script + mkdir -p /var/run/quantum + chown quantum:root /var/run/quantum + mkdir -p /var/lib/quantum + chown quantum:root /var/lib/quantum + mkdir -p /var/log/quantum + chown quantum:root /var/log/quantum +end script + +script + exec start-stop-daemon --start --chuid quantum --exec /opt/stack/quantum/bin/quantum-server -- \ + --config-file /etc/quantum/quantum.conf \ + --log-file /var/log/quantum/server.log +end script diff --git a/elements/quantum-api/install.d/05-quantum-api b/elements/quantum-api/install.d/05-quantum-api new file mode 100755 index 00000000..300c70c8 --- /dev/null +++ b/elements/quantum-api/install.d/05-quantum-api @@ -0,0 +1,34 @@ +#!/bin/sh +set -e +set -o xtrace + +useradd -G admin -m quantum -s /bin/false + +DEBIAN_FRONTEND=noninteractive apt-get -y install \ + python-pip git-core python-setuptools python-dev python-lxml python-netaddr \ + python-pastescript python-pastedeploy python-paste python-sqlalchemy \ + python-greenlet python-routes python-simplejson python-webob rabbitmq-server + +OS_ROOT=/opt/stack +mkdir -p $OS_ROOT + +# clone source +QUANTUM_ROOT=$OS_ROOT/quantum +git clone https://github.com/openstack/quantum.git $QUANTUM_ROOT +cd $QUANTUM_ROOT +git checkout master + +# pip dependencies +python setup.py egg_info +pip install -r quantum.egg-info/requires.txt +python setup.py install +cd - + +# config +mkdir -p /etc/quantum +cp $QUANTUM_ROOT/etc/quantum.conf /etc/quantum +cp $QUANTUM_ROOT/etc/policy.json /etc/quantum +cp $QUANTUM_ROOT/etc/api-paste.ini /etc/quantum + +# default is 'fake plugin', with which service won't start +sed -i 's/core_plugin =.*/core_plugin = quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2/' /etc/quantum/quantum.conf