add an openrc file so that users can easily use the client
This commit is contained in:
parent
148b13ac88
commit
6ab10d46a8
2 changed files with 43 additions and 38 deletions
40
exercise.sh
40
exercise.sh
|
@ -19,44 +19,8 @@ set -o xtrace
|
||||||
# Settings
|
# Settings
|
||||||
# ========
|
# ========
|
||||||
|
|
||||||
# Use stackrc and localrc for settings
|
# Use openrc + stackrc + localrc for settings
|
||||||
source ./stackrc
|
source ./openrc
|
||||||
|
|
||||||
HOST=${HOST:-localhost}
|
|
||||||
|
|
||||||
# Nova original used project_id as the *account* that owned resources (servers,
|
|
||||||
# ip address, ...) With the addition of Keystone we have standardized on the
|
|
||||||
# term **tenant** as the entity that owns the resources. **novaclient** still
|
|
||||||
# uses the old deprecated terms project_id. Note that this field should now be
|
|
||||||
# set to tenant_name, not tenant_id.
|
|
||||||
export NOVA_PROJECT_ID=${TENANT:-demo}
|
|
||||||
|
|
||||||
# In addition to the owning entity (tenant), nova stores the entity performing
|
|
||||||
# the action as the **user**.
|
|
||||||
export NOVA_USERNAME=${USERNAME:-demo}
|
|
||||||
|
|
||||||
# With Keystone you pass the keystone password instead of an api key.
|
|
||||||
export NOVA_API_KEY=${ADMIN_PASSWORD:-secrete}
|
|
||||||
|
|
||||||
# With the addition of Keystone, to use an openstack cloud you should
|
|
||||||
# authenticate against keystone, which returns a **Token** and **Service
|
|
||||||
# Catalog**. The catalog contains the endpoint for all services the user/tenant
|
|
||||||
# has access to - including nova, glance, keystone, swift, ... We currently
|
|
||||||
# recommend using the 2.0 *auth api*.
|
|
||||||
#
|
|
||||||
# *NOTE*: Using the 2.0 *auth api* does mean that compute api is 2.0. We will
|
|
||||||
# use the 1.1 *compute api*
|
|
||||||
export NOVA_URL=${NOVA_URL:-http://$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=1.1
|
|
||||||
|
|
||||||
# FIXME - why does this need to be specified?
|
|
||||||
export NOVA_REGION_NAME=RegionOne
|
|
||||||
|
|
||||||
# set log level to DEBUG (helps debug issues)
|
|
||||||
export NOVACLIENT_DEBUG=1
|
|
||||||
|
|
||||||
# Get a token for clients that don't support service catalog
|
# Get a token for clients that don't support service catalog
|
||||||
# ==========================================================
|
# ==========================================================
|
||||||
|
|
41
openrc
Normal file
41
openrc
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Load local configuration
|
||||||
|
source ./stackrc
|
||||||
|
|
||||||
|
# Set api host endpoint
|
||||||
|
HOST=${HOST:-localhost}
|
||||||
|
|
||||||
|
# Nova original used project_id as the *account* that owned resources (servers,
|
||||||
|
# ip address, ...) With the addition of Keystone we have standardized on the
|
||||||
|
# term **tenant** as the entity that owns the resources. **novaclient** still
|
||||||
|
# uses the old deprecated terms project_id. Note that this field should now be
|
||||||
|
# set to tenant_name, not tenant_id.
|
||||||
|
export NOVA_PROJECT_ID=${TENANT:-demo}
|
||||||
|
|
||||||
|
# In addition to the owning entity (tenant), nova stores the entity performing
|
||||||
|
# the action as the **user**.
|
||||||
|
export NOVA_USERNAME=${USERNAME:-demo}
|
||||||
|
|
||||||
|
# With Keystone you pass the keystone password instead of an api key.
|
||||||
|
export NOVA_API_KEY=${ADMIN_PASSWORD:-secrete}
|
||||||
|
|
||||||
|
# With the addition of Keystone, to use an openstack cloud you should
|
||||||
|
# authenticate against keystone, which returns a **Token** and **Service
|
||||||
|
# Catalog**. The catalog contains the endpoint for all services the user/tenant
|
||||||
|
# has access to - including nova, glance, keystone, swift, ... We currently
|
||||||
|
# recommend using the 2.0 *auth api*.
|
||||||
|
#
|
||||||
|
# *NOTE*: Using the 2.0 *auth api* does mean that compute api is 2.0. We will
|
||||||
|
# use the 1.1 *compute api*
|
||||||
|
export NOVA_URL=${NOVA_URL:-http://$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=1.1
|
||||||
|
|
||||||
|
# FIXME - why does this need to be specified?
|
||||||
|
export NOVA_REGION_NAME=RegionOne
|
||||||
|
|
||||||
|
# set log level to DEBUG (helps debug issues)
|
||||||
|
export NOVACLIENT_DEBUG=1
|
Loading…
Reference in a new issue