From 2fcb64ee77c6ee72142dab1170ef1a3a03f9a5a7 Mon Sep 17 00:00:00 2001 From: Tim Miller Date: Thu, 13 Dec 2012 15:48:18 -0800 Subject: [PATCH] Add glance-api element. Change-Id: I277b353fbbed59823335c8b27e875c4417e2643d --- elements/glance-api/README.md | 2 ++ .../glance-api/first-boot.d/05-glance-api | 7 ++++ .../first-boot.d/etc_init_glance-api.conf | 9 +++++ elements/glance-api/install.d/05-glance-api | 33 +++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 elements/glance-api/README.md create mode 100755 elements/glance-api/first-boot.d/05-glance-api create mode 100644 elements/glance-api/first-boot.d/etc_init_glance-api.conf create mode 100755 elements/glance-api/install.d/05-glance-api diff --git a/elements/glance-api/README.md b/elements/glance-api/README.md new file mode 100644 index 00000000..a2c4f4d5 --- /dev/null +++ b/elements/glance-api/README.md @@ -0,0 +1,2 @@ +Installs the Glance API Service from github. + diff --git a/elements/glance-api/first-boot.d/05-glance-api b/elements/glance-api/first-boot.d/05-glance-api new file mode 100755 index 00000000..be52f4f0 --- /dev/null +++ b/elements/glance-api/first-boot.d/05-glance-api @@ -0,0 +1,7 @@ +#!/bin/bash +set -e +set -o xtrace + +# upstart script +cp -f $(dirname $0)/etc_init_glance-api.conf /etc/init/glance-api.conf + diff --git a/elements/glance-api/first-boot.d/etc_init_glance-api.conf b/elements/glance-api/first-boot.d/etc_init_glance-api.conf new file mode 100644 index 00000000..62fbede2 --- /dev/null +++ b/elements/glance-api/first-boot.d/etc_init_glance-api.conf @@ -0,0 +1,9 @@ +description "OpenStack Glance API service" + +start on (local-filesystems and net-device-up IFACE!=lo) +stop on runlevel [016] + +respawn + +exec su -s /bin/sh -c "exec /opt/stack/glance/bin/glance-api --config-file /etc/glance/glance-api.conf --log-config /etc/glance/logging.conf" + diff --git a/elements/glance-api/install.d/05-glance-api b/elements/glance-api/install.d/05-glance-api new file mode 100755 index 00000000..82d867f8 --- /dev/null +++ b/elements/glance-api/install.d/05-glance-api @@ -0,0 +1,33 @@ +#!/bin/sh + +# install glance-api + +set -e +set -o xtrace + +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 +GLANCE_ROOT=$OS_ROOT/glance +git clone https://github.com/openstack/glance.git $GLANCE_ROOT +cd $GLANCE_ROOT +git checkout master + +# pip dependencies +python setup.py egg_info +pip install -r glance.egg-info/requires.txt +cd - + +# config +mkdir -p /etc/glance +cp $GLANCE_ROOT/etc/glance-api.conf /etc/glance +cp $GLANCE_ROOT/etc/policy.json /etc/glance +cp $GLANCE_ROOT/etc/glance-api-paste.ini /etc/glance +cp $GLANCE_ROOT/etc/logging.cnf.sample /etc/glance/logging.conf +