0bd2410d46
* Remove credential creation from files/keystone_data.sh * Remove EC2 cert setup from openrc * Remove sourcing of ec2rc from stackrc * Collect the above in eucarc * Allow rc files to be sourced from other directories; based on Chmouel's 4881 proposal but is simpler and doesn't actually change the directory * Create S3 endpoint * Get EC2 and S3 endpoints from Keystone service catalog * Add EC2 credential checks to exercises/client-env.sh * exercises/bundle.sh and exercises/euca.sh use eucarc Updates: * remove readlink -f to stay bash 3 compatible * use service catalog * create S3 endpoint Fixes bug 949528 Change-Id: I58caea8cecbbd10661779bc2d150d241f4a5822e
83 lines
3.0 KiB
Bash
83 lines
3.0 KiB
Bash
#!/usr/bin/env bash
|
|
#
|
|
# source openrc [username] [tenantname]
|
|
#
|
|
# Configure a set of credentials for $TENANT/$USERNAME:
|
|
# Set TENANT to override the default tenant 'demo'
|
|
# Set USERNAME to override the default user name 'demo'
|
|
# Set ADMIN_PASSWORD to set the password for 'admin' and 'demo'
|
|
|
|
# NOTE: support for the old NOVA_* novaclient environment variables has
|
|
# been removed.
|
|
|
|
if [[ -n "$1" ]]; then
|
|
USERNAME=$1
|
|
fi
|
|
if [[ -n "$2" ]]; then
|
|
TENANT=$2
|
|
fi
|
|
|
|
# Find the other rc files
|
|
RC_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd)
|
|
|
|
# Load local configuration
|
|
source $RC_DIR/stackrc
|
|
|
|
# The introduction of Keystone to the OpenStack ecosystem has standardized the
|
|
# term **tenant** as the entity that owns resources. In some places references
|
|
# still exist to the original Nova term **project** for this use. Also,
|
|
# **tenant_name** is prefered to **tenant_id**.
|
|
export OS_TENANT_NAME=${TENANT:-demo}
|
|
|
|
# In addition to the owning entity (tenant), nova stores the entity performing
|
|
# the action as the **user**.
|
|
export OS_USERNAME=${USERNAME:-demo}
|
|
|
|
# With Keystone you pass the keystone password instead of an api key.
|
|
# Recent versions of novaclient use OS_PASSWORD instead of NOVA_API_KEYs
|
|
# or NOVA_PASSWORD.
|
|
export OS_PASSWORD=${ADMIN_PASSWORD:-secrete}
|
|
|
|
# Set api HOST_IP endpoint. SERVICE_HOST may also be used to specify the endpoint,
|
|
# which is convenient for some localrc configurations.
|
|
HOST_IP=${HOST_IP:-127.0.0.1}
|
|
SERVICE_HOST=${SERVICE_HOST:-$HOST_IP}
|
|
|
|
# Some exercises call glance directly. On a single-node installation, Glance
|
|
# should be listening on HOST_IP. If its running elsewhere, it can be set here
|
|
GLANCE_HOST=${GLANCE_HOST:-$HOST_IP}
|
|
|
|
# Authenticating against an Openstack cloud using Keystone returns a **Token**
|
|
# and **Service Catalog**. The catalog contains the endpoints for all services
|
|
# the user/tenant has access to - including nova, glance, keystone, swift, ...
|
|
# We currently recommend using the 2.0 *identity api*.
|
|
#
|
|
# *NOTE*: Using the 2.0 *identity api* does not mean that compute api is 2.0. We
|
|
# will use the 1.1 *compute api*
|
|
export OS_AUTH_URL=http://$SERVICE_HOST:5000/v2.0
|
|
|
|
# Currently novaclient needs you to specify the *compute api* version. This
|
|
# needs to match the config of your catalog returned by Keystone.
|
|
export NOVA_VERSION=${NOVA_VERSION:-1.1}
|
|
# In the future this will change names:
|
|
export COMPUTE_API_VERSION=${COMPUTE_API_VERSION:-$NOVA_VERSION}
|
|
|
|
# set log level to DEBUG (helps debug issues)
|
|
# export KEYSTONECLIENT_DEBUG=1
|
|
# export NOVACLIENT_DEBUG=1
|
|
|
|
# Max time till the vm is bootable
|
|
export BOOT_TIMEOUT=${BOOT_TIMEOUT:-30}
|
|
|
|
# Max time to wait while vm goes from build to active state
|
|
export ACTIVE_TIMEOUT=${ACTIVE_TIMEOUT:-30}
|
|
|
|
# Max time from run instance command until it is running
|
|
export RUNNING_TIMEOUT=${RUNNING_TIMEOUT:-$(($BOOT_TIMEOUT + $ACTIVE_TIMEOUT))}
|
|
|
|
# Max time to wait for proper IP association and dis-association.
|
|
export ASSOCIATE_TIMEOUT=${ASSOCIATE_TIMEOUT:-15}
|
|
|
|
# Max time to wait for a vm to terminate
|
|
export TERMINATE_TIMEOUT=${TERMINATE_TIMEOUT:-30}
|