83a3c784af
For some reason .venv wouldn't install the pip packages. Fixed installation. Change-Id: I5a80c42976c9534290f278561dc2e23edd5a04a9
47 lines
979 B
Bash
Executable File
47 lines
979 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ $# -ne 2 ]; then
|
|
echo "Usage: `basename $0` <HOST_IP> <SERVICE_PASSWORD>"
|
|
exit -1
|
|
fi
|
|
|
|
PORT=8118
|
|
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.0' \
|
|
-f value -cid \
|
|
multisite)
|
|
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
|