blob: 77f6b93330638a809068d4db6662d3965ab4d17f [file] [log] [blame]
Jesse Andrews73e27b82011-09-12 17:55:00 -07001#!/bin/bash
2BIN_DIR=${BIN_DIR:-.}
3# Tenants
Jesse Andrewsb89c7512011-12-21 23:17:42 -08004$BIN_DIR/keystone-manage tenant add admin
5$BIN_DIR/keystone-manage tenant add demo
6$BIN_DIR/keystone-manage tenant add invisible_to_admin
Jesse Andrews73e27b82011-09-12 17:55:00 -07007
8# Users
Jesse Andrewsb89c7512011-12-21 23:17:42 -08009$BIN_DIR/keystone-manage user add admin %ADMIN_PASSWORD%
10$BIN_DIR/keystone-manage user add demo %ADMIN_PASSWORD%
Jesse Andrews73e27b82011-09-12 17:55:00 -070011
12# Roles
Anthony Youngaf0f7ca2012-01-20 12:10:39 -080013$BIN_DIR/keystone-manage role add admin
Jesse Andrewsb89c7512011-12-21 23:17:42 -080014$BIN_DIR/keystone-manage role add Member
15$BIN_DIR/keystone-manage role add KeystoneAdmin
16$BIN_DIR/keystone-manage role add KeystoneServiceAdmin
17$BIN_DIR/keystone-manage role add sysadmin
18$BIN_DIR/keystone-manage role add netadmin
Anthony Youngaf0f7ca2012-01-20 12:10:39 -080019$BIN_DIR/keystone-manage role grant admin admin admin
Jesse Andrewsb89c7512011-12-21 23:17:42 -080020$BIN_DIR/keystone-manage role grant Member demo demo
21$BIN_DIR/keystone-manage role grant sysadmin demo demo
22$BIN_DIR/keystone-manage role grant netadmin demo demo
23$BIN_DIR/keystone-manage role grant Member demo invisible_to_admin
Anthony Youngaf0f7ca2012-01-20 12:10:39 -080024$BIN_DIR/keystone-manage role grant admin admin demo
25$BIN_DIR/keystone-manage role grant admin admin
Jesse Andrewsb89c7512011-12-21 23:17:42 -080026$BIN_DIR/keystone-manage role grant KeystoneAdmin admin
27$BIN_DIR/keystone-manage role grant KeystoneServiceAdmin admin
Jesse Andrews73e27b82011-09-12 17:55:00 -070028
Anthony Young8bdc2632011-09-22 08:00:44 +000029# Services
Jesse Andrewsb89c7512011-12-21 23:17:42 -080030$BIN_DIR/keystone-manage service add nova compute "Nova Compute Service"
31$BIN_DIR/keystone-manage service add ec2 ec2 "EC2 Compatability Layer"
32$BIN_DIR/keystone-manage service add glance image "Glance Image Service"
33$BIN_DIR/keystone-manage service add keystone identity "Keystone Identity Service"
Jesse Andrews9c7c9082011-11-23 10:10:53 -080034if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
Jesse Andrewsb89c7512011-12-21 23:17:42 -080035 $BIN_DIR/keystone-manage service add swift object-store "Swift Service"
Jesse Andrews9c7c9082011-11-23 10:10:53 -080036fi
Anthony Young8bdc2632011-09-22 08:00:44 +000037
Jesse Andrews73e27b82011-09-12 17:55:00 -070038#endpointTemplates
Anthony Young1097c7c2011-12-27 23:22:14 -080039$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
40$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
Kiall Mac Innes34694f12011-12-30 18:53:26 +000041$BIN_DIR/keystone-manage $* endpointTemplates add RegionOne glance http://%SERVICE_HOST%:9292/v1 http://%SERVICE_HOST%:9292/v1 http://%SERVICE_HOST%:9292/v1 1 1
Dean Troyer6577b462012-01-16 22:27:20 -060042$BIN_DIR/keystone-manage $* endpointTemplates add RegionOne keystone %KEYSTONE_SERVICE_PROTOCOL%://%KEYSTONE_SERVICE_HOST%:%KEYSTONE_SERVICE_PORT%/v2.0 %KEYSTONE_AUTH_PROTOCOL%://%KEYSTONE_AUTH_HOST%:%KEYSTONE_AUTH_PORT%/v2.0 %KEYSTONE_SERVICE_PROTOCOL%://%KEYSTONE_SERVICE_HOST%:%KEYSTONE_SERVICE_PORT%/v2.0 1 1
Jesse Andrews9c7c9082011-11-23 10:10:53 -080043if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
Anthony Young1097c7c2011-12-27 23:22:14 -080044 $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
Jesse Andrews9c7c9082011-11-23 10:10:53 -080045fi
Anthony Young8bdc2632011-09-22 08:00:44 +000046
Jesse Andrews73e27b82011-09-12 17:55:00 -070047# Tokens
Jesse Andrewsb89c7512011-12-21 23:17:42 -080048$BIN_DIR/keystone-manage token add %SERVICE_TOKEN% admin admin 2015-02-05T00:00
Jesse Andrews73e27b82011-09-12 17:55:00 -070049
Vishvananda Ishayaf56e3952011-10-24 16:05:57 -070050# EC2 related creds - note we are setting the secret key to ADMIN_PASSWORD
Vishvananda Ishaya9b353672011-10-20 10:07:10 -070051# but keystone doesn't parse them - it is just a blob from keystone's
Jesse Andrews89358af2011-10-02 14:11:17 -040052# point of view
Jesse Andrewsb89c7512011-12-21 23:17:42 -080053$BIN_DIR/keystone-manage credentials add admin EC2 'admin' '%ADMIN_PASSWORD%' admin || echo "no support for adding credentials"
54$BIN_DIR/keystone-manage credentials add demo EC2 'demo' '%ADMIN_PASSWORD%' demo || echo "no support for adding credentials"