Glance/Cinder/Keystone/Swift: don't hard code venv

Updates the cinder/glance/keystone/swift elements so that we use a new
{SERVICE}_VENV_DIR variable (set via an environment.d hook)
to configure the virtualenv directory.

This is cleaner in that we aren't hard coding /opt/stack/venv
everywhere and also supports both isolated and shared
venvs (which some people would like to use).

Change-Id: Ic2cbbf48bad0db092fe6c0a5a9ddda6f883a499b
This commit is contained in:
Dan Prince 2014-02-26 14:30:38 -05:00
parent bbc98e0393
commit 8eb1faea81
11 changed files with 12 additions and 8 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash
set -eux
ln -s /opt/stack/venvs/cinder/bin/cinder-manage /usr/local/bin/cinder-manage
ln -s $CINDER_VENV_DIR/bin/cinder-manage /usr/local/bin/cinder-manage
os-svc-daemon cinder-api cinder cinder-api "--config-dir /etc/cinder"
os-svc-daemon cinder-scheduler cinder cinder-scheduler "--config-dir /etc/cinder"

View File

@ -0,0 +1 @@
export CINDER_VENV_DIR=${CINDER_VENV_DIR:-"/opt/stack/venvs/cinder"}

View File

@ -9,7 +9,7 @@ cp -a /opt/stack/cinder/etc/cinder/rootwrap* /etc/cinder
cp /opt/stack/cinder/etc/cinder/api-paste.ini /etc/cinder/api-paste.ini
cp /opt/stack/cinder/etc/cinder/policy.json /etc/cinder/policy.json
ln -sf /opt/stack/venvs/cinder/bin/cinder-rootwrap /usr/local/bin/cinder-rootwrap
ln -sf $CINDER_VENV_DIR/bin/cinder-rootwrap /usr/local/bin/cinder-rootwrap
echo "cinder ALL=(root) NOPASSWD: /usr/local/bin/cinder-rootwrap" > /etc/sudoers.d/cinder
chmod 0440 /etc/sudoers.d/cinder

View File

@ -0,0 +1 @@
export GLANCE_VENV_DIR=${GLANCE_VENV_DIR:-"/opt/stack/venvs/glance"}

View File

@ -5,7 +5,7 @@ install-packages python-mysqldb libssl-dev
os-svc-install -u glance -r /opt/stack/glance
ln -s /opt/stack/venvs/glance/bin/glance-manage /usr/local/bin/glance-manage
ln -s $GLANCE_VENV_DIR/bin/glance-manage /usr/local/bin/glance-manage
cp /opt/stack/glance/etc/policy.json /etc/glance/policy.json
cp /opt/stack/glance/etc/schema-image.json /etc/glance/schema-image.json

View File

@ -0,0 +1 @@
export KEYSTONE_VENV_DIR=${KEYSTONE_VENV_DIR:-"/opt/stack/venvs/keystone"}

View File

@ -3,5 +3,5 @@ set -eux
os-svc-install -u keystone -r /opt/stack/keystone
# Workaround for https://bugs.launchpad.net/tripleo/+bug/1288425
/opt/stack/venvs/keystone/bin/pip install -U kombu
/opt/stack/venvs/keystone/bin/pip install -U qpid-python
$KEYSTONE_VENV_DIR/bin/pip install -U kombu
$KEYSTONE_VENV_DIR/bin/pip install -U qpid-python

View File

@ -7,7 +7,7 @@ os-svc-install -u keystone -r /opt/stack/keystone
os-svc-daemon keystone keystone keystone-all "--config-dir /etc/keystone"
install -m 0755 -o keystone -g keystone -d /etc/keystone/ssl
ln -s /opt/stack/venvs/keystone/bin/keystone-manage /usr/local/bin/keystone-manage
ln -s $KEYSTONE_VENV_DIR/bin/keystone-manage /usr/local/bin/keystone-manage
cp /opt/stack/keystone/etc/policy.json /etc/keystone/policy.json
cp /opt/stack/keystone/etc/keystone-paste.ini /etc/keystone/keystone-paste.ini

View File

@ -3,6 +3,6 @@
set -eux
# This is only needed if using keystone auth, so isn't in requirements.txt
/opt/stack/venvs/swift/bin/pip install python-keystoneclient
$SWIFT_VENV_DIR/bin/pip install python-keystoneclient
os-svc-daemon swift-proxy swift swift-proxy-server "/etc/swift/proxy-server.conf"

View File

@ -0,0 +1 @@
export SWIFT_VENV_DIR=${SWIFT_VENV_DIR:-"/opt/stack/venvs/swift"}

View File

@ -6,4 +6,4 @@ install-packages libffi-dev
os-svc-install -u swift -r /opt/stack/swift
install -m 0755 -o root -g root /opt/stack/venvs/swift/bin/swift-ring-builder /usr/local/bin
install -m 0755 -o root -g root $SWIFT_VENV_DIR/bin/swift-ring-builder /usr/local/bin