Skip to content

Instantly share code, notes, and snippets.

@jmvrbanac
Last active August 29, 2015 14:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmvrbanac/abe30c0cf6872b76dee4 to your computer and use it in GitHub Desktop.
Save jmvrbanac/abe30c0cf6872b76dee4 to your computer and use it in GitHub Desktop.
Add the Barbican service user and endpoint to a dev keystone
#!/bin/bash
get_id () {
echo `$@ | awk '/ id / { print $4 }'`
}
export OS_SERVICE_TOKEN="ADMIN_TOKEN"
export OS_SERVICE_ENDPOINT="http://localhost:35357/v2.0"
SERVICE_ID=$(get_id keystone service-create --name=barbican --type="key-manager" --description="Key_Management_Service")
keystone endpoint-create \
--region RegionOne \
--service-id=$SERVICE_ID \
--publicurl=http://localhost:9311/v1 \
--internalurl=http://localhost:9311/v1 \
--adminurl=http://localhost:9311/v1
ADMIN_ROLE=$(get_id keystone role-get admin)
tenant_id=$(get_id keystone tenant-create --name="service")
user_id=$(get_id keystone user-create --name="barbican" --pass="barbican" --email=admin@domain.com)
keystone user-role-add --user $user_id --role $ADMIN_ROLE --tenant-id $tenant_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment