30 lines
652 B
Bash
Executable File
30 lines
652 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ $# -ne 1 ]; then
|
|
echo "Usage: `basename $0` <HOST_IP>"
|
|
exit -1
|
|
fi
|
|
|
|
PORT=8778
|
|
HOST=$1 # Put your host IP here
|
|
|
|
SERVICE_ID=$(openstack service show senlin -f value -cid 2>/dev/null)
|
|
if [[ -z $SERVICE_ID ]]; then
|
|
SERVICE_ID=$(openstack service create \
|
|
--name senlin \
|
|
--description 'Senlin Clustering Service V1' \
|
|
-f value -cid \
|
|
clustering)
|
|
fi
|
|
|
|
if [[ -z $SERVICE_ID ]]; then
|
|
exit
|
|
fi
|
|
|
|
openstack endpoint create \
|
|
--adminurl "http://$HOST:$PORT/v1/\$(tenant_id)s" \
|
|
--publicurl "http://$HOST:$PORT/v1/\$(tenant_id)s" \
|
|
--internalurl "http://$HOST:$PORT/v1/\$(tenant_id)s" \
|
|
--region RegionOne \
|
|
senlin
|