Merge "Update Swift configuration with keystone latest."
This commit is contained in:
commit
995bfe0252
@ -23,18 +23,22 @@ popd
|
||||
# Testing Swift
|
||||
# =============
|
||||
|
||||
# FIXME(chmou): when review https://review.openstack.org/#change,3712
|
||||
# is merged we would be able to use the common openstack options and
|
||||
# remove the trailing slash to v2.0 auth url.
|
||||
#
|
||||
# Check if we have to swift via keystone
|
||||
swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0 -U admin -K $ADMIN_PASSWORD stat
|
||||
swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0/ -U admin -K $ADMIN_PASSWORD stat
|
||||
|
||||
# We start by creating a test container
|
||||
swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0 -U admin -K $ADMIN_PASSWORD post testcontainer
|
||||
swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0/ -U admin -K $ADMIN_PASSWORD post testcontainer
|
||||
|
||||
# add some files into it.
|
||||
swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0 -U admin -K $ADMIN_PASSWORD upload testcontainer /etc/issue
|
||||
swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0/ -U admin -K $ADMIN_PASSWORD upload testcontainer /etc/issue
|
||||
|
||||
# list them
|
||||
swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0 -U admin -K $ADMIN_PASSWORD list testcontainer
|
||||
swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0/ -U admin -K $ADMIN_PASSWORD list testcontainer
|
||||
|
||||
# And we may want to delete them now that we have tested that
|
||||
# everything works.
|
||||
swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0 -U admin -K $ADMIN_PASSWORD delete testcontainer
|
||||
swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0/ -U admin -K $ADMIN_PASSWORD delete testcontainer
|
||||
|
@ -8,7 +8,7 @@ log_facility = LOG_LOCAL1
|
||||
log_level = DEBUG
|
||||
|
||||
[pipeline:main]
|
||||
pipeline = healthcheck cache %AUTH_SERVER% proxy-server
|
||||
pipeline = healthcheck cache swift3 %AUTH_SERVER% proxy-server
|
||||
|
||||
[app:proxy-server]
|
||||
use = egg:swift#proxy
|
||||
@ -16,10 +16,32 @@ allow_account_management = true
|
||||
account_autocreate = true
|
||||
|
||||
[filter:keystone]
|
||||
use = egg:swiftkeystone2#keystone2
|
||||
keystone_admin_token = %SERVICE_TOKEN%
|
||||
keystone_url = http://localhost:35357/v2.0
|
||||
keystone_swift_operator_roles = Member,admin
|
||||
paste.filter_factory = keystone.middleware.swift_auth:filter_factory
|
||||
operator_roles = Member,admin
|
||||
|
||||
[filter:s3token]
|
||||
paste.filter_factory = keystone.middleware.s3_token:filter_factory
|
||||
service_port = %KEYSTONE_SERVICE_PORT%
|
||||
service_host = %KEYSTONE_SERVICE_HOST%
|
||||
auth_port = %KEYSTONE_AUTH_PORT%
|
||||
auth_host = %KEYSTONE_AUTH_HOST%
|
||||
auth_protocol = %KEYSTONE_AUTH_PROTOCOL%
|
||||
auth_token = %SERVICE_TOKEN%
|
||||
admin_token = %SERVICE_TOKEN%
|
||||
|
||||
[filter:tokenauth]
|
||||
paste.filter_factory = keystone.middleware.auth_token:filter_factory
|
||||
service_port = %KEYSTONE_SERVICE_PORT%
|
||||
service_host = %KEYSTONE_SERVICE_HOST%
|
||||
auth_port = %KEYSTONE_AUTH_PORT%
|
||||
auth_host = %KEYSTONE_AUTH_HOST%
|
||||
auth_protocol = %KEYSTONE_AUTH_PROTOCOL%
|
||||
auth_token = %SERVICE_TOKEN%
|
||||
admin_token = %SERVICE_TOKEN%
|
||||
cache = swift.cache
|
||||
|
||||
[filter:swift3]
|
||||
use = egg:swift#swift3
|
||||
|
||||
[filter:tempauth]
|
||||
use = egg:swift#tempauth
|
||||
|
23
stack.sh
23
stack.sh
@ -162,7 +162,6 @@ NOVACLIENT_DIR=$DEST/python-novaclient
|
||||
KEYSTONECLIENT_DIR=$DEST/python-keystoneclient
|
||||
NOVNC_DIR=$DEST/noVNC
|
||||
SWIFT_DIR=$DEST/swift
|
||||
SWIFT_KEYSTONE_DIR=$DEST/swift-keystone2
|
||||
QUANTUM_DIR=$DEST/quantum
|
||||
QUANTUM_CLIENT_DIR=$DEST/python-quantumclient
|
||||
MELANGE_DIR=$DEST/melange
|
||||
@ -570,8 +569,6 @@ fi
|
||||
if is_service_enabled swift; then
|
||||
# storage service
|
||||
git_clone $SWIFT_REPO $SWIFT_DIR $SWIFT_BRANCH
|
||||
# swift + keystone middleware
|
||||
git_clone $SWIFT_KEYSTONE_REPO $SWIFT_KEYSTONE_DIR $SWIFT_KEYSTONE_BRANCH
|
||||
fi
|
||||
if is_service_enabled g-api n-api; then
|
||||
# image catalog service
|
||||
@ -615,7 +612,6 @@ if is_service_enabled key g-api n-api swift; then
|
||||
fi
|
||||
if is_service_enabled swift; then
|
||||
cd $SWIFT_DIR; sudo python setup.py develop
|
||||
cd $SWIFT_KEYSTONE_DIR; sudo python setup.py develop
|
||||
fi
|
||||
if is_service_enabled g-api n-api; then
|
||||
cd $GLANCE_DIR; sudo python setup.py develop
|
||||
@ -1007,19 +1003,24 @@ if is_service_enabled swift; then
|
||||
# which has some default username and password if you have
|
||||
# configured keystone it will checkout the directory.
|
||||
if is_service_enabled key; then
|
||||
swift_auth_server=keystone
|
||||
|
||||
# We install the memcache server as this is will be used by the
|
||||
# middleware to cache the tokens auths for a long this is needed.
|
||||
apt_get install memcached
|
||||
swift_auth_server="s3token tokenauth keystone"
|
||||
else
|
||||
swift_auth_server=tempauth
|
||||
fi
|
||||
|
||||
# We do the install of the proxy-server and swift configuration
|
||||
# replacing a few directives to match our configuration.
|
||||
sed "s,%SWIFT_CONFIG_LOCATION%,${SWIFT_CONFIG_LOCATION},;s/%USER%/$USER/;s/%SERVICE_TOKEN%/${SERVICE_TOKEN}/;s/%AUTH_SERVER%/${swift_auth_server}/" \
|
||||
$FILES/swift/proxy-server.conf|sudo tee ${SWIFT_CONFIG_LOCATION}/proxy-server.conf
|
||||
sed -e "s,%SWIFT_CONFIG_LOCATION%,${SWIFT_CONFIG_LOCATION},g;
|
||||
s,%USER%,$USER,g;
|
||||
s,%SERVICE_TOKEN%,${SERVICE_TOKEN},g;
|
||||
s,%KEYSTONE_SERVICE_PORT%,${KEYSTONE_SERVICE_PORT},g;
|
||||
s,%KEYSTONE_SERVICE_HOST%,${KEYSTONE_SERVICE_HOST},g;
|
||||
s,%KEYSTONE_AUTH_PORT%,${KEYSTONE_AUTH_PORT},g;
|
||||
s,%KEYSTONE_AUTH_HOST%,${KEYSTONE_AUTH_HOST},g;
|
||||
s,%KEYSTONE_AUTH_PROTOCOL%,${KEYSTONE_AUTH_PROTOCOL},g;
|
||||
s/%AUTH_SERVER%/${swift_auth_server}/g;" \
|
||||
$FILES/swift/proxy-server.conf | \
|
||||
sudo tee ${SWIFT_CONFIG_LOCATION}/proxy-server.conf
|
||||
|
||||
sed -e "s/%SWIFT_HASH%/$SWIFT_HASH/" $FILES/swift/swift.conf > ${SWIFT_CONFIG_LOCATION}/swift.conf
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user