09c99dc02d
These tools will help developers to create a virtual environment with pre-installed requirements. kingbird.conf generation script will collect the defined properties and create a configuration file. Change-Id: I5d423df88a5ff08346fe9e3c9b08fd9379cf1878
48 lines
984 B
Bash
48 lines
984 B
Bash
#!/bin/bash
|
|
|
|
if [ $# -ne 2 ]; then
|
|
echo "Usage: `basename $0` <HOST_IP> <SERVICE_PASSWORD>"
|
|
exit -1
|
|
fi
|
|
|
|
PORT=8778
|
|
HOST=$1 # Put your host IP here
|
|
SVC_PASSWD=$2
|
|
|
|
SERVICE_ID=$(openstack service show kingbird -f value -cid 2>/dev/null)
|
|
if [[ -z $SERVICE_ID ]]; then
|
|
SERVICE_ID=$(openstack service create \
|
|
--name kingbird \
|
|
--description 'Kingbird Service V1' \
|
|
-f value -cid \
|
|
synchronisation)
|
|
fi
|
|
|
|
if [[ -z $SERVICE_ID ]]; then
|
|
exit
|
|
fi
|
|
|
|
openstack endpoint create \
|
|
--adminurl "http://$HOST:$PORT/v1.0/\$(tenant_id)s" \
|
|
--publicurl "http://$HOST:$PORT/v1.0/\$(tenant_id)s" \
|
|
--internalurl "http://$HOST:$PORT/v1.0/\$(tenant_id)s" \
|
|
--region RegionOne \
|
|
kingbird
|
|
|
|
openstack user create \
|
|
--password "$SVC_PASSWD" \
|
|
--project service \
|
|
kingbird
|
|
|
|
openstack role add \
|
|
admin \
|
|
--user kingbird \
|
|
--project service
|
|
|
|
# make sure 'kingbird' has 'service' role in 'demo' project
|
|
openstack role add \
|
|
service \
|
|
--user kingbird \
|
|
--project demo
|
|
|