Jesse Andrews | 73e27b8 | 2011-09-12 17:55:00 -0700 | [diff] [blame] | 1 | #!/bin/bash |
Dean Troyer | b7d1fbb | 2012-03-02 08:43:09 -0600 | [diff] [blame] | 2 | # |
| 3 | # Initial data for Keystone using python-keystoneclient |
| 4 | # |
Doug Hellmann | 4a2b1c6 | 2012-11-01 16:23:52 -0400 | [diff] [blame] | 5 | # Tenant User Roles |
Chmouel Boudjnah | 77b0e1d | 2012-02-29 16:55:43 +0000 | [diff] [blame] | 6 | # ------------------------------------------------------------------ |
Doug Hellmann | 4a2b1c6 | 2012-11-01 16:23:52 -0400 | [diff] [blame] | 7 | # admin admin admin |
| 8 | # service glance admin |
| 9 | # service nova admin, [ResellerAdmin (swift only)] |
| 10 | # service quantum admin # if enabled |
| 11 | # service swift admin # if enabled |
| 12 | # service cinder admin # if enabled |
| 13 | # service heat admin # if enabled |
| 14 | # service ceilometer admin # if enabled |
| 15 | # demo admin admin |
| 16 | # demo demo Member, anotherrole |
| 17 | # invisible_to_admin demo Member |
Jay Pipes | b297d2d | 2012-05-10 11:21:22 -0400 | [diff] [blame] | 18 | # Tempest Only: |
| 19 | # alt_demo alt_demo Member |
Dean Troyer | b7d1fbb | 2012-03-02 08:43:09 -0600 | [diff] [blame] | 20 | # |
| 21 | # Variables set before calling this script: |
| 22 | # SERVICE_TOKEN - aka admin_token in keystone.conf |
| 23 | # SERVICE_ENDPOINT - local Keystone admin endpoint |
| 24 | # SERVICE_TENANT_NAME - name of tenant containing service accounts |
Dean Troyer | 3f7c06f | 2012-04-03 17:19:36 -0500 | [diff] [blame] | 25 | # SERVICE_HOST - host used for endpoint creation |
Dean Troyer | b7d1fbb | 2012-03-02 08:43:09 -0600 | [diff] [blame] | 26 | # ENABLED_SERVICES - stack.sh's list of services to start |
| 27 | # DEVSTACK_DIR - Top-level DevStack directory |
Dean Troyer | 3f7c06f | 2012-04-03 17:19:36 -0500 | [diff] [blame] | 28 | # KEYSTONE_CATALOG_BACKEND - used to determine service catalog creation |
| 29 | |
| 30 | # Defaults |
| 31 | # -------- |
Dean Troyer | b7d1fbb | 2012-03-02 08:43:09 -0600 | [diff] [blame] | 32 | |
| 33 | ADMIN_PASSWORD=${ADMIN_PASSWORD:-secrete} |
| 34 | SERVICE_PASSWORD=${SERVICE_PASSWORD:-$ADMIN_PASSWORD} |
Vishvananda Ishaya | d1f5243 | 2012-02-09 03:50:57 +0000 | [diff] [blame] | 35 | export SERVICE_TOKEN=$SERVICE_TOKEN |
| 36 | export SERVICE_ENDPOINT=$SERVICE_ENDPOINT |
Dean Troyer | b7d1fbb | 2012-03-02 08:43:09 -0600 | [diff] [blame] | 37 | SERVICE_TENANT_NAME=${SERVICE_TENANT_NAME:-service} |
Vishvananda Ishaya | d1f5243 | 2012-02-09 03:50:57 +0000 | [diff] [blame] | 38 | |
| 39 | function get_id () { |
Dean Troyer | 3f7c06f | 2012-04-03 17:19:36 -0500 | [diff] [blame] | 40 | echo `"$@" | awk '/ id / { print $4 }'` |
Vishvananda Ishaya | d1f5243 | 2012-02-09 03:50:57 +0000 | [diff] [blame] | 41 | } |
| 42 | |
Dean Troyer | 3f7c06f | 2012-04-03 17:19:36 -0500 | [diff] [blame] | 43 | |
Dean Troyer | b7d1fbb | 2012-03-02 08:43:09 -0600 | [diff] [blame] | 44 | # Tenants |
Dean Troyer | 3f7c06f | 2012-04-03 17:19:36 -0500 | [diff] [blame] | 45 | # ------- |
| 46 | |
Dean Troyer | b7d1fbb | 2012-03-02 08:43:09 -0600 | [diff] [blame] | 47 | ADMIN_TENANT=$(get_id keystone tenant-create --name=admin) |
| 48 | SERVICE_TENANT=$(get_id keystone tenant-create --name=$SERVICE_TENANT_NAME) |
| 49 | DEMO_TENANT=$(get_id keystone tenant-create --name=demo) |
| 50 | INVIS_TENANT=$(get_id keystone tenant-create --name=invisible_to_admin) |
termie | a96a418 | 2012-01-09 22:13:29 -0800 | [diff] [blame] | 51 | |
Jesse Andrews | 73e27b8 | 2011-09-12 17:55:00 -0700 | [diff] [blame] | 52 | |
| 53 | # Users |
Dean Troyer | 3f7c06f | 2012-04-03 17:19:36 -0500 | [diff] [blame] | 54 | # ----- |
| 55 | |
Dean Troyer | b7d1fbb | 2012-03-02 08:43:09 -0600 | [diff] [blame] | 56 | ADMIN_USER=$(get_id keystone user-create --name=admin \ |
| 57 | --pass="$ADMIN_PASSWORD" \ |
| 58 | --email=admin@example.com) |
| 59 | DEMO_USER=$(get_id keystone user-create --name=demo \ |
| 60 | --pass="$ADMIN_PASSWORD" \ |
| 61 | --email=demo@example.com) |
Jesse Andrews | 73e27b8 | 2011-09-12 17:55:00 -0700 | [diff] [blame] | 62 | |
Dean Troyer | 0bd2410 | 2012-03-08 00:33:54 -0600 | [diff] [blame] | 63 | |
Jesse Andrews | 73e27b8 | 2011-09-12 17:55:00 -0700 | [diff] [blame] | 64 | # Roles |
Dean Troyer | 3f7c06f | 2012-04-03 17:19:36 -0500 | [diff] [blame] | 65 | # ----- |
| 66 | |
Dean Troyer | b7d1fbb | 2012-03-02 08:43:09 -0600 | [diff] [blame] | 67 | ADMIN_ROLE=$(get_id keystone role-create --name=admin) |
| 68 | KEYSTONEADMIN_ROLE=$(get_id keystone role-create --name=KeystoneAdmin) |
| 69 | KEYSTONESERVICE_ROLE=$(get_id keystone role-create --name=KeystoneServiceAdmin) |
Anthony Young | ae60498 | 2012-03-12 17:12:00 -0700 | [diff] [blame] | 70 | # ANOTHER_ROLE demonstrates that an arbitrary role may be created and used |
| 71 | # TODO(sleepsonthefloor): show how this can be used for rbac in the future! |
| 72 | ANOTHER_ROLE=$(get_id keystone role-create --name=anotherrole) |
termie | a96a418 | 2012-01-09 22:13:29 -0800 | [diff] [blame] | 73 | |
| 74 | |
Dean Troyer | b7d1fbb | 2012-03-02 08:43:09 -0600 | [diff] [blame] | 75 | # Add Roles to Users in Tenants |
Everett Toews | a143e73 | 2012-05-08 22:13:08 +0000 | [diff] [blame] | 76 | keystone user-role-add --user_id $ADMIN_USER --role_id $ADMIN_ROLE --tenant_id $ADMIN_TENANT |
| 77 | keystone user-role-add --user_id $ADMIN_USER --role_id $ADMIN_ROLE --tenant_id $DEMO_TENANT |
| 78 | keystone user-role-add --user_id $DEMO_USER --role_id $ANOTHER_ROLE --tenant_id $DEMO_TENANT |
termie | a96a418 | 2012-01-09 22:13:29 -0800 | [diff] [blame] | 79 | |
Dean Troyer | b7d1fbb | 2012-03-02 08:43:09 -0600 | [diff] [blame] | 80 | # TODO(termie): these two might be dubious |
Everett Toews | a143e73 | 2012-05-08 22:13:08 +0000 | [diff] [blame] | 81 | keystone user-role-add --user_id $ADMIN_USER --role_id $KEYSTONEADMIN_ROLE --tenant_id $ADMIN_TENANT |
| 82 | keystone user-role-add --user_id $ADMIN_USER --role_id $KEYSTONESERVICE_ROLE --tenant_id $ADMIN_TENANT |
Dean Troyer | f4565c4 | 2012-02-23 11:21:10 -0600 | [diff] [blame] | 83 | |
Dean Troyer | b7d1fbb | 2012-03-02 08:43:09 -0600 | [diff] [blame] | 84 | |
| 85 | # The Member role is used by Horizon and Swift so we need to keep it: |
| 86 | MEMBER_ROLE=$(get_id keystone role-create --name=Member) |
Everett Toews | a143e73 | 2012-05-08 22:13:08 +0000 | [diff] [blame] | 87 | keystone user-role-add --user_id $DEMO_USER --role_id $MEMBER_ROLE --tenant_id $DEMO_TENANT |
| 88 | keystone user-role-add --user_id $DEMO_USER --role_id $MEMBER_ROLE --tenant_id $INVIS_TENANT |
Dean Troyer | b7d1fbb | 2012-03-02 08:43:09 -0600 | [diff] [blame] | 89 | |
Jesse Andrews | 73e27b8 | 2011-09-12 17:55:00 -0700 | [diff] [blame] | 90 | |
Dean Troyer | 3f7c06f | 2012-04-03 17:19:36 -0500 | [diff] [blame] | 91 | # Services |
| 92 | # -------- |
termie | a96a418 | 2012-01-09 22:13:29 -0800 | [diff] [blame] | 93 | |
Dean Troyer | 3f7c06f | 2012-04-03 17:19:36 -0500 | [diff] [blame] | 94 | # Keystone |
| 95 | if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then |
| 96 | KEYSTONE_SERVICE=$(get_id keystone service-create \ |
| 97 | --name=keystone \ |
| 98 | --type=identity \ |
| 99 | --description="Keystone Identity Service") |
| 100 | keystone endpoint-create \ |
| 101 | --region RegionOne \ |
| 102 | --service_id $KEYSTONE_SERVICE \ |
| 103 | --publicurl "http://$SERVICE_HOST:\$(public_port)s/v2.0" \ |
| 104 | --adminurl "http://$SERVICE_HOST:\$(admin_port)s/v2.0" \ |
Steve Baker | 8d6c9bc | 2012-09-11 10:05:14 +1200 | [diff] [blame] | 105 | --internalurl "http://$SERVICE_HOST:\$(public_port)s/v2.0" |
Dean Troyer | 3f7c06f | 2012-04-03 17:19:36 -0500 | [diff] [blame] | 106 | fi |
Vishvananda Ishaya | 5f9473e | 2012-02-24 01:57:07 +0000 | [diff] [blame] | 107 | |
Dean Troyer | 3f7c06f | 2012-04-03 17:19:36 -0500 | [diff] [blame] | 108 | # Nova |
| 109 | if [[ "$ENABLED_SERVICES" =~ "n-cpu" ]]; then |
| 110 | NOVA_USER=$(get_id keystone user-create \ |
| 111 | --name=nova \ |
| 112 | --pass="$SERVICE_PASSWORD" \ |
| 113 | --tenant_id $SERVICE_TENANT \ |
| 114 | --email=nova@example.com) |
| 115 | keystone user-role-add \ |
| 116 | --tenant_id $SERVICE_TENANT \ |
| 117 | --user_id $NOVA_USER \ |
| 118 | --role_id $ADMIN_ROLE |
| 119 | if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then |
| 120 | NOVA_SERVICE=$(get_id keystone service-create \ |
| 121 | --name=nova \ |
| 122 | --type=compute \ |
| 123 | --description="Nova Compute Service") |
| 124 | keystone endpoint-create \ |
| 125 | --region RegionOne \ |
| 126 | --service_id $NOVA_SERVICE \ |
Steve Baker | 8d6c9bc | 2012-09-11 10:05:14 +1200 | [diff] [blame] | 127 | --publicurl "http://$SERVICE_HOST:\$(compute_port)s/v2/\$(tenant_id)s" \ |
| 128 | --adminurl "http://$SERVICE_HOST:\$(compute_port)s/v2/\$(tenant_id)s" \ |
| 129 | --internalurl "http://$SERVICE_HOST:\$(compute_port)s/v2/\$(tenant_id)s" |
Dean Troyer | 3f7c06f | 2012-04-03 17:19:36 -0500 | [diff] [blame] | 130 | fi |
Chmouel Boudjnah | 77b0e1d | 2012-02-29 16:55:43 +0000 | [diff] [blame] | 131 | # Nova needs ResellerAdmin role to download images when accessing |
| 132 | # swift through the s3 api. The admin role in swift allows a user |
| 133 | # to act as an admin for their tenant, but ResellerAdmin is needed |
| 134 | # for a user to act as any tenant. The name of this role is also |
| 135 | # configurable in swift-proxy.conf |
| 136 | RESELLER_ROLE=$(get_id keystone role-create --name=ResellerAdmin) |
Dean Troyer | 3f7c06f | 2012-04-03 17:19:36 -0500 | [diff] [blame] | 137 | keystone user-role-add \ |
| 138 | --tenant_id $SERVICE_TENANT \ |
| 139 | --user_id $NOVA_USER \ |
| 140 | --role_id $RESELLER_ROLE |
Jesse Andrews | 9c7c908 | 2011-11-23 10:10:53 -0800 | [diff] [blame] | 141 | fi |
Dean Troyer | b7d1fbb | 2012-03-02 08:43:09 -0600 | [diff] [blame] | 142 | |
Dean Troyer | 3f7c06f | 2012-04-03 17:19:36 -0500 | [diff] [blame] | 143 | # Volume |
| 144 | if [[ "$ENABLED_SERVICES" =~ "n-vol" ]]; then |
| 145 | if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then |
| 146 | VOLUME_SERVICE=$(get_id keystone service-create \ |
| 147 | --name=volume \ |
| 148 | --type=volume \ |
| 149 | --description="Volume Service") |
| 150 | keystone endpoint-create \ |
| 151 | --region RegionOne \ |
| 152 | --service_id $VOLUME_SERVICE \ |
| 153 | --publicurl "http://$SERVICE_HOST:8776/v1/\$(tenant_id)s" \ |
| 154 | --adminurl "http://$SERVICE_HOST:8776/v1/\$(tenant_id)s" \ |
| 155 | --internalurl "http://$SERVICE_HOST:8776/v1/\$(tenant_id)s" |
| 156 | fi |
| 157 | fi |
| 158 | |
Steve Baker | bfdad75 | 2012-08-18 09:00:42 +1200 | [diff] [blame] | 159 | # Heat |
| 160 | if [[ "$ENABLED_SERVICES" =~ "heat" ]]; then |
| 161 | HEAT_USER=$(get_id keystone user-create --name=heat \ |
| 162 | --pass="$SERVICE_PASSWORD" \ |
| 163 | --tenant_id $SERVICE_TENANT \ |
| 164 | --email=heat@example.com) |
| 165 | keystone user-role-add --tenant_id $SERVICE_TENANT \ |
| 166 | --user_id $HEAT_USER \ |
| 167 | --role_id $ADMIN_ROLE |
| 168 | if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then |
Steve Baker | 36cf7ee | 2012-09-17 16:49:24 +1200 | [diff] [blame] | 169 | HEAT_CFN_SERVICE=$(get_id keystone service-create \ |
Steve Baker | bb421be | 2012-10-10 13:19:10 +1300 | [diff] [blame] | 170 | --name=heat-cfn \ |
| 171 | --type=cloudformation \ |
| 172 | --description="Heat CloudFormation Service") |
Steve Baker | bfdad75 | 2012-08-18 09:00:42 +1200 | [diff] [blame] | 173 | keystone endpoint-create \ |
| 174 | --region RegionOne \ |
Angus Salkeld | e279021 | 2012-09-11 11:24:09 +1000 | [diff] [blame] | 175 | --service_id $HEAT_CFN_SERVICE \ |
| 176 | --publicurl "http://$SERVICE_HOST:$HEAT_API_CFN_PORT/v1" \ |
| 177 | --adminurl "http://$SERVICE_HOST:$HEAT_API_CFN_PORT/v1" \ |
| 178 | --internalurl "http://$SERVICE_HOST:$HEAT_API_CFN_PORT/v1" |
Steve Baker | bb421be | 2012-10-10 13:19:10 +1300 | [diff] [blame] | 179 | HEAT_SERVICE=$(get_id keystone service-create \ |
| 180 | --name=heat \ |
| 181 | --type=orchestration \ |
| 182 | --description="Heat Service") |
| 183 | keystone endpoint-create \ |
| 184 | --region RegionOne \ |
| 185 | --service_id $HEAT_SERVICE \ |
| 186 | --publicurl "http://$SERVICE_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s" \ |
| 187 | --adminurl "http://$SERVICE_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s" \ |
| 188 | --internalurl "http://$SERVICE_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s" |
Steve Baker | bfdad75 | 2012-08-18 09:00:42 +1200 | [diff] [blame] | 189 | fi |
| 190 | fi |
| 191 | |
Dean Troyer | 3f7c06f | 2012-04-03 17:19:36 -0500 | [diff] [blame] | 192 | # Glance |
| 193 | if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then |
| 194 | GLANCE_USER=$(get_id keystone user-create \ |
| 195 | --name=glance \ |
| 196 | --pass="$SERVICE_PASSWORD" \ |
| 197 | --tenant_id $SERVICE_TENANT \ |
| 198 | --email=glance@example.com) |
| 199 | keystone user-role-add \ |
| 200 | --tenant_id $SERVICE_TENANT \ |
| 201 | --user_id $GLANCE_USER \ |
| 202 | --role_id $ADMIN_ROLE |
| 203 | if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then |
| 204 | GLANCE_SERVICE=$(get_id keystone service-create \ |
| 205 | --name=glance \ |
| 206 | --type=image \ |
| 207 | --description="Glance Image Service") |
| 208 | keystone endpoint-create \ |
| 209 | --region RegionOne \ |
| 210 | --service_id $GLANCE_SERVICE \ |
Steve Baker | 8d6c9bc | 2012-09-11 10:05:14 +1200 | [diff] [blame] | 211 | --publicurl "http://$SERVICE_HOST:9292" \ |
| 212 | --adminurl "http://$SERVICE_HOST:9292" \ |
| 213 | --internalurl "http://$SERVICE_HOST:9292" |
Dean Troyer | 3f7c06f | 2012-04-03 17:19:36 -0500 | [diff] [blame] | 214 | fi |
| 215 | fi |
| 216 | |
| 217 | # Swift |
| 218 | if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then |
| 219 | SWIFT_USER=$(get_id keystone user-create \ |
| 220 | --name=swift \ |
| 221 | --pass="$SERVICE_PASSWORD" \ |
| 222 | --tenant_id $SERVICE_TENANT \ |
| 223 | --email=swift@example.com) |
| 224 | keystone user-role-add \ |
| 225 | --tenant_id $SERVICE_TENANT \ |
| 226 | --user_id $SWIFT_USER \ |
| 227 | --role_id $ADMIN_ROLE |
| 228 | if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then |
| 229 | SWIFT_SERVICE=$(get_id keystone service-create \ |
| 230 | --name=swift \ |
| 231 | --type="object-store" \ |
| 232 | --description="Swift Service") |
| 233 | keystone endpoint-create \ |
| 234 | --region RegionOne \ |
| 235 | --service_id $SWIFT_SERVICE \ |
| 236 | --publicurl "http://$SERVICE_HOST:8080/v1/AUTH_\$(tenant_id)s" \ |
Steve Baker | 8d6c9bc | 2012-09-11 10:05:14 +1200 | [diff] [blame] | 237 | --adminurl "http://$SERVICE_HOST:8080" \ |
Dean Troyer | 3f7c06f | 2012-04-03 17:19:36 -0500 | [diff] [blame] | 238 | --internalurl "http://$SERVICE_HOST:8080/v1/AUTH_\$(tenant_id)s" |
| 239 | fi |
| 240 | fi |
| 241 | |
| 242 | if [[ "$ENABLED_SERVICES" =~ "q-svc" ]]; then |
| 243 | QUANTUM_USER=$(get_id keystone user-create \ |
| 244 | --name=quantum \ |
| 245 | --pass="$SERVICE_PASSWORD" \ |
| 246 | --tenant_id $SERVICE_TENANT \ |
| 247 | --email=quantum@example.com) |
| 248 | keystone user-role-add \ |
| 249 | --tenant_id $SERVICE_TENANT \ |
| 250 | --user_id $QUANTUM_USER \ |
| 251 | --role_id $ADMIN_ROLE |
| 252 | if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then |
| 253 | QUANTUM_SERVICE=$(get_id keystone service-create \ |
| 254 | --name=quantum \ |
| 255 | --type=network \ |
| 256 | --description="Quantum Service") |
| 257 | keystone endpoint-create \ |
| 258 | --region RegionOne \ |
| 259 | --service_id $QUANTUM_SERVICE \ |
| 260 | --publicurl "http://$SERVICE_HOST:9696/" \ |
| 261 | --adminurl "http://$SERVICE_HOST:9696/" \ |
| 262 | --internalurl "http://$SERVICE_HOST:9696/" |
| 263 | fi |
| 264 | fi |
| 265 | |
Doug Hellmann | 4a2b1c6 | 2012-11-01 16:23:52 -0400 | [diff] [blame] | 266 | if [[ "$ENABLED_SERVICES" =~ "ceilometer" ]]; then |
| 267 | CEILOMETER_USER=$(get_id keystone user-create --name=ceilometer \ |
| 268 | --pass="$SERVICE_PASSWORD" \ |
| 269 | --tenant_id $SERVICE_TENANT \ |
| 270 | --email=ceilometer@example.com) |
| 271 | keystone user-role-add --tenant_id $SERVICE_TENANT \ |
| 272 | --user_id $CEILOMETER_USER \ |
| 273 | --role_id $ADMIN_ROLE |
Julien Danjou | f36afe5 | 2012-10-04 18:00:10 +0200 | [diff] [blame] | 274 | if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then |
| 275 | CEILOMETER_SERVICE=$(get_id keystone service-create \ |
| 276 | --name=ceilometer \ |
| 277 | --type=metering \ |
| 278 | --description="Ceilometer Service") |
| 279 | keystone endpoint-create \ |
| 280 | --region RegionOne \ |
| 281 | --service_id $CEILOMETER_SERVICE \ |
| 282 | --publicurl "http://$SERVICE_HOST:8777/" \ |
| 283 | --adminurl "http://$SERVICE_HOST:8777/" \ |
| 284 | --internalurl "http://$SERVICE_HOST:8777/" |
| 285 | fi |
| 286 | fi |
| 287 | |
Dean Troyer | 3f7c06f | 2012-04-03 17:19:36 -0500 | [diff] [blame] | 288 | # EC2 |
| 289 | if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then |
| 290 | if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then |
| 291 | EC2_SERVICE=$(get_id keystone service-create \ |
| 292 | --name=ec2 \ |
| 293 | --type=ec2 \ |
| 294 | --description="EC2 Compatibility Layer") |
| 295 | keystone endpoint-create \ |
| 296 | --region RegionOne \ |
| 297 | --service_id $EC2_SERVICE \ |
| 298 | --publicurl "http://$SERVICE_HOST:8773/services/Cloud" \ |
| 299 | --adminurl "http://$SERVICE_HOST:8773/services/Admin" \ |
| 300 | --internalurl "http://$SERVICE_HOST:8773/services/Cloud" |
| 301 | fi |
| 302 | fi |
| 303 | |
| 304 | # S3 |
| 305 | if [[ "$ENABLED_SERVICES" =~ "n-obj" || "$ENABLED_SERVICES" =~ "swift" ]]; then |
| 306 | if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then |
| 307 | S3_SERVICE=$(get_id keystone service-create \ |
| 308 | --name=s3 \ |
| 309 | --type=s3 \ |
| 310 | --description="S3") |
| 311 | keystone endpoint-create \ |
| 312 | --region RegionOne \ |
| 313 | --service_id $S3_SERVICE \ |
| 314 | --publicurl "http://$SERVICE_HOST:$S3_SERVICE_PORT" \ |
| 315 | --adminurl "http://$SERVICE_HOST:$S3_SERVICE_PORT" \ |
| 316 | --internalurl "http://$SERVICE_HOST:$S3_SERVICE_PORT" |
| 317 | fi |
Gabriel Hurley | a3a496f | 2012-02-13 12:29:23 -0800 | [diff] [blame] | 318 | fi |
Jay Pipes | b297d2d | 2012-05-10 11:21:22 -0400 | [diff] [blame] | 319 | |
| 320 | if [[ "$ENABLED_SERVICES" =~ "tempest" ]]; then |
| 321 | # Tempest has some tests that validate various authorization checks |
| 322 | # between two regular users in separate tenants |
Dean Troyer | 3f7c06f | 2012-04-03 17:19:36 -0500 | [diff] [blame] | 323 | ALT_DEMO_TENANT=$(get_id keystone tenant-create \ |
| 324 | --name=alt_demo) |
| 325 | ALT_DEMO_USER=$(get_id keystone user-create \ |
| 326 | --name=alt_demo \ |
| 327 | --pass="$ADMIN_PASSWORD" \ |
| 328 | --email=alt_demo@example.com) |
| 329 | keystone user-role-add \ |
| 330 | --tenant_id $ALT_DEMO_TENANT \ |
| 331 | --user_id $ALT_DEMO_USER \ |
| 332 | --role_id $MEMBER_ROLE |
Jay Pipes | b297d2d | 2012-05-10 11:21:22 -0400 | [diff] [blame] | 333 | fi |
Dean Troyer | 67787e6 | 2012-05-02 11:48:15 -0500 | [diff] [blame] | 334 | |
Chmouel Boudjnah | d55509d | 2012-07-20 15:00:02 +0000 | [diff] [blame] | 335 | if [[ "$ENABLED_SERVICES" =~ "c-api" ]]; then |
Dean Troyer | 67787e6 | 2012-05-02 11:48:15 -0500 | [diff] [blame] | 336 | CINDER_USER=$(get_id keystone user-create --name=cinder \ |
| 337 | --pass="$SERVICE_PASSWORD" \ |
| 338 | --tenant_id $SERVICE_TENANT \ |
| 339 | --email=cinder@example.com) |
| 340 | keystone user-role-add --tenant_id $SERVICE_TENANT \ |
| 341 | --user_id $CINDER_USER \ |
| 342 | --role_id $ADMIN_ROLE |
Anthony Young | 1cdf5fa | 2012-07-03 13:57:39 -0700 | [diff] [blame] | 343 | if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then |
| 344 | CINDER_SERVICE=$(get_id keystone service-create \ |
| 345 | --name=cinder \ |
| 346 | --type=volume \ |
| 347 | --description="Cinder Service") |
| 348 | keystone endpoint-create \ |
| 349 | --region RegionOne \ |
| 350 | --service_id $CINDER_SERVICE \ |
| 351 | --publicurl "http://$SERVICE_HOST:8776/v1/\$(tenant_id)s" \ |
| 352 | --adminurl "http://$SERVICE_HOST:8776/v1/\$(tenant_id)s" \ |
| 353 | --internalurl "http://$SERVICE_HOST:8776/v1/\$(tenant_id)s" |
| 354 | fi |
Dean Troyer | 67787e6 | 2012-05-02 11:48:15 -0500 | [diff] [blame] | 355 | fi |