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:
parent
bbc98e0393
commit
8eb1faea81
|
@ -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"
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
export CINDER_VENV_DIR=${CINDER_VENV_DIR:-"/opt/stack/venvs/cinder"}
|
|
@ -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
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
export GLANCE_VENV_DIR=${GLANCE_VENV_DIR:-"/opt/stack/venvs/glance"}
|
|
@ -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
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
export KEYSTONE_VENV_DIR=${KEYSTONE_VENV_DIR:-"/opt/stack/venvs/keystone"}
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
export SWIFT_VENV_DIR=${SWIFT_VENV_DIR:-"/opt/stack/venvs/swift"}
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue