Port work on SERVICE_HOST from stable/diablo. Allows user to specify service endpoint host separately from HOST_IP

* Improve openrc comment

Change-Id: Ib542b39350bae8d92b6c3c4cf6b5d9aabff7a61c
This commit is contained in:
Anthony Young 2011-12-27 23:22:14 -08:00
parent c1b2354a88
commit 1097c7ca91
3 changed files with 23 additions and 15 deletions

View File

@ -36,12 +36,12 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
fi fi
#endpointTemplates #endpointTemplates
$BIN_DIR/keystone-manage endpointTemplates add RegionOne nova http://%HOST_IP%:8774/v1.1/%tenant_id% http://%HOST_IP%:8774/v1.1/%tenant_id% http://%HOST_IP%:8774/v1.1/%tenant_id% 1 1 $BIN_DIR/keystone-manage $* endpointTemplates add RegionOne nova http://%SERVICE_HOST%:8774/v1.1/%tenant_id% http://%SERVICE_HOST%:8774/v1.1/%tenant_id% http://%SERVICE_HOST%:8774/v1.1/%tenant_id% 1 1
$BIN_DIR/keystone-manage endpointTemplates add RegionOne ec2 http://%HOST_IP%:8773/services/Cloud http://%HOST_IP%:8773/services/Admin http://%HOST_IP%:8773/services/Cloud 1 1 $BIN_DIR/keystone-manage $* endpointTemplates add RegionOne ec2 http://%SERVICE_HOST%:8773/services/Cloud http://%SERVICE_HOST%:8773/services/Admin http://%SERVICE_HOST%:8773/services/Cloud 1 1
$BIN_DIR/keystone-manage endpointTemplates add RegionOne glance http://%HOST_IP%:9292/v1.1/%tenant_id% http://%HOST_IP%:9292/v1.1/%tenant_id% http://%HOST_IP%:9292/v1.1/%tenant_id% 1 1 $BIN_DIR/keystone-manage $* endpointTemplates add RegionOne glance http://%SERVICE_HOST%:9292/v1.1/%tenant_id% http://%SERVICE_HOST%:9292/v1.1/%tenant_id% http://%SERVICE_HOST%:9292/v1.1/%tenant_id% 1 1
$BIN_DIR/keystone-manage endpointTemplates add RegionOne keystone http://%HOST_IP%:5000/v2.0 http://%HOST_IP%:35357/v2.0 http://%HOST_IP%:5000/v2.0 1 1 $BIN_DIR/keystone-manage $* endpointTemplates add RegionOne keystone http://%SERVICE_HOST%:5000/v2.0 http://%SERVICE_HOST%:35357/v2.0 http://%SERVICE_HOST%:5000/v2.0 1 1
if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
$BIN_DIR/keystone-manage endpointTemplates add RegionOne swift http://%HOST_IP%:8080/v1/AUTH_%tenant_id% http://%HOST_IP%:8080/ http://%HOST_IP%:8080/v1/AUTH_%tenant_id% 1 1 $BIN_DIR/keystone-manage $* endpointTemplates add RegionOne swift http://%SERVICE_HOST%:8080/v1/AUTH_%tenant_id% http://%SERVICE_HOST%:8080/ http://%SERVICE_HOST%:8080/v1/AUTH_%tenant_id% 1 1
fi fi
# Tokens # Tokens

8
openrc
View File

@ -3,8 +3,10 @@
# Load local configuration # Load local configuration
source ./stackrc source ./stackrc
# Set api host endpoint # 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} HOST_IP=${HOST_IP:-127.0.0.1}
SERVICE_HOST=${SERVICE_HOST:-$HOST_IP}
# Nova original used project_id as the *account* that owned resources (servers, # Nova original used project_id as the *account* that owned resources (servers,
# ip address, ...) With the addition of Keystone we have standardized on the # ip address, ...) With the addition of Keystone we have standardized on the
@ -29,7 +31,7 @@ export NOVA_PASSWORD=${ADMIN_PASSWORD:-secrete}
# #
# *NOTE*: Using the 2.0 *auth api* does not mean that compute api is 2.0. We # *NOTE*: Using the 2.0 *auth api* does not mean that compute api is 2.0. We
# will use the 1.1 *compute api* # will use the 1.1 *compute api*
export NOVA_URL=${NOVA_URL:-http://$HOST_IP:5000/v2.0/} export NOVA_URL=${NOVA_URL:-http://$SERVICE_HOST:5000/v2.0/}
# Currently novaclient needs you to specify the *compute api* version. This # Currently novaclient needs you to specify the *compute api* version. This
# needs to match the config of your catalog returned by Keystone. # needs to match the config of your catalog returned by Keystone.
@ -39,7 +41,7 @@ export NOVA_VERSION=${NOVA_VERSION:-1.1}
export NOVA_REGION_NAME=${NOVA_REGION_NAME:-RegionOne} export NOVA_REGION_NAME=${NOVA_REGION_NAME:-RegionOne}
# Set the ec2 url so euca2ools works # Set the ec2 url so euca2ools works
export EC2_URL=${EC2_URL:-http://$HOST_IP:8773/services/Cloud} export EC2_URL=${EC2_URL:-http://$SERVICE_HOST:8773/services/Cloud}
# Access key is set in the initial keystone data to be the same as username # Access key is set in the initial keystone data to be the same as username
export EC2_ACCESS_KEY=${USERNAME:-demo} export EC2_ACCESS_KEY=${USERNAME:-demo}

View File

@ -214,6 +214,9 @@ if [ ! -n "$HOST_IP" ]; then
fi fi
fi fi
# Allow the use of an alternate hostname (such as localhost/127.0.0.1) for service endpoints.
SERVICE_HOST=${SERVICE_HOST:-$HOST_IP}
# Configure services to syslog instead of writing to individual log files # Configure services to syslog instead of writing to individual log files
SYSLOG=`trueorfalse False $SYSLOG` SYSLOG=`trueorfalse False $SYSLOG`
SYSLOG_HOST=${SYSLOG_HOST:-$HOST_IP} SYSLOG_HOST=${SYSLOG_HOST:-$HOST_IP}
@ -270,7 +273,7 @@ FIXED_RANGE=${FIXED_RANGE:-10.0.0.0/24}
FIXED_NETWORK_SIZE=${FIXED_NETWORK_SIZE:-256} FIXED_NETWORK_SIZE=${FIXED_NETWORK_SIZE:-256}
FLOATING_RANGE=${FLOATING_RANGE:-172.24.4.224/28} FLOATING_RANGE=${FLOATING_RANGE:-172.24.4.224/28}
NET_MAN=${NET_MAN:-FlatDHCPManager} NET_MAN=${NET_MAN:-FlatDHCPManager}
EC2_DMZ_HOST=${EC2_DMZ_HOST:-$HOST_IP} EC2_DMZ_HOST=${EC2_DMZ_HOST:-$SERVICE_HOST}
FLAT_NETWORK_BRIDGE=${FLAT_NETWORK_BRIDGE:-br100} FLAT_NETWORK_BRIDGE=${FLAT_NETWORK_BRIDGE:-br100}
VLAN_INTERFACE=${VLAN_INTERFACE:-$PUBLIC_INTERFACE} VLAN_INTERFACE=${VLAN_INTERFACE:-$PUBLIC_INTERFACE}
@ -333,7 +336,7 @@ RABBIT_HOST=${RABBIT_HOST:-localhost}
read_password RABBIT_PASSWORD "ENTER A PASSWORD TO USE FOR RABBIT." read_password RABBIT_PASSWORD "ENTER A PASSWORD TO USE FOR RABBIT."
# Glance connection info. Note the port must be specified. # Glance connection info. Note the port must be specified.
GLANCE_HOSTPORT=${GLANCE_HOSTPORT:-$HOST_IP:9292} GLANCE_HOSTPORT=${GLANCE_HOSTPORT:-$SERVICE_HOST:9292}
# SWIFT # SWIFT
# ----- # -----
@ -1061,7 +1064,7 @@ if [[ "$ENABLED_SERVICES" =~ "openstackx" ]]; then
add_nova_flag "--osapi_extension=extensions.admin.Admin" add_nova_flag "--osapi_extension=extensions.admin.Admin"
fi fi
if [[ "$ENABLED_SERVICES" =~ "n-vnc" ]]; then if [[ "$ENABLED_SERVICES" =~ "n-vnc" ]]; then
VNCPROXY_URL=${VNCPROXY_URL:-"http://$HOST_IP:6080"} VNCPROXY_URL=${VNCPROXY_URL:-"http://$SERVICE_HOST:6080"}
add_nova_flag "--vncproxy_url=$VNCPROXY_URL" add_nova_flag "--vncproxy_url=$VNCPROXY_URL"
add_nova_flag "--vncproxy_wwwroot=$NOVNC_DIR/" add_nova_flag "--vncproxy_wwwroot=$NOVNC_DIR/"
fi fi
@ -1142,7 +1145,7 @@ if [[ "$ENABLED_SERVICES" =~ "key" ]]; then
# keystone_data.sh creates our admin user and our ``SERVICE_TOKEN``. # keystone_data.sh creates our admin user and our ``SERVICE_TOKEN``.
KEYSTONE_DATA=$KEYSTONE_DIR/bin/keystone_data.sh KEYSTONE_DATA=$KEYSTONE_DIR/bin/keystone_data.sh
cp $FILES/keystone_data.sh $KEYSTONE_DATA cp $FILES/keystone_data.sh $KEYSTONE_DATA
sudo sed -e "s,%HOST_IP%,$HOST_IP,g" -i $KEYSTONE_DATA sudo sed -e "s,%SERVICE_HOST%,$SERVICE_HOST,g" -i $KEYSTONE_DATA
sudo sed -e "s,%SERVICE_TOKEN%,$SERVICE_TOKEN,g" -i $KEYSTONE_DATA sudo sed -e "s,%SERVICE_TOKEN%,$SERVICE_TOKEN,g" -i $KEYSTONE_DATA
sudo sed -e "s,%ADMIN_PASSWORD%,$ADMIN_PASSWORD,g" -i $KEYSTONE_DATA sudo sed -e "s,%ADMIN_PASSWORD%,$ADMIN_PASSWORD,g" -i $KEYSTONE_DATA
# initialize keystone with default users/endpoints # initialize keystone with default users/endpoints
@ -1399,18 +1402,21 @@ echo ""
# If you installed the horizon on this server, then you should be able # If you installed the horizon on this server, then you should be able
# to access the site using your browser. # to access the site using your browser.
if [[ "$ENABLED_SERVICES" =~ "horizon" ]]; then if [[ "$ENABLED_SERVICES" =~ "horizon" ]]; then
echo "horizon is now available at http://$HOST_IP/" echo "horizon is now available at http://$SERVICE_HOST/"
fi fi
# If keystone is present, you can point nova cli to this server # If keystone is present, you can point nova cli to this server
if [[ "$ENABLED_SERVICES" =~ "key" ]]; then if [[ "$ENABLED_SERVICES" =~ "key" ]]; then
echo "keystone is serving at http://$HOST_IP:5000/v2.0/" echo "keystone is serving at http://$SERVICE_HOST:5000/v2.0/"
echo "examples on using novaclient command line is in exercise.sh" echo "examples on using novaclient command line is in exercise.sh"
echo "the default users are: admin and demo" echo "the default users are: admin and demo"
echo "the password: $ADMIN_PASSWORD" echo "the password: $ADMIN_PASSWORD"
fi fi
# indicate how long this took to run (bash maintained variable 'SECONDS') # Echo HOST_IP - useful for build_uec.sh, which uses dhcp to give the instance an address
echo "This is your host ip: $HOST_IP"
# Indicate how long this took to run (bash maintained variable 'SECONDS')
echo "stack.sh completed in $SECONDS seconds." echo "stack.sh completed in $SECONDS seconds."
) | tee -a "$LOGFILE" ) | tee -a "$LOGFILE"