Browse code

Add ResellerAdmin role to ceilometer user.

For the sake of swift metering, 'ceilometer' user needs to be a
ResellerAdmin for tenant 'service'.

Change-Id: I65b3bdedddded9d5f3bac5c5d714288800ffa8b6

guillaume pernot authored on 2012/11/29 16:44:58
Showing 1 changed files
... ...
@@ -87,6 +87,11 @@ MEMBER_ROLE=$(get_id keystone role-create --name=Member)
87 87
 keystone user-role-add --user_id $DEMO_USER --role_id $MEMBER_ROLE --tenant_id $DEMO_TENANT
88 88
 keystone user-role-add --user_id $DEMO_USER --role_id $MEMBER_ROLE --tenant_id $INVIS_TENANT
89 89
 
90
+# The ResellerAdmin role is used by Nova and Ceilometer so we need to keep it.
91
+# The admin role in swift allows a user to act as an admin for their tenant,
92
+# but ResellerAdmin is needed for a user to act as any tenant. The name of this
93
+# role is also configurable in swift-proxy.conf
94
+RESELLER_ROLE=$(get_id keystone role-create --name=ResellerAdmin)
90 95
 
91 96
 # Services
92 97
 # --------
... ...
@@ -129,11 +134,7 @@ if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then
129 129
             --internalurl "http://$SERVICE_HOST:\$(compute_port)s/v2/\$(tenant_id)s"
130 130
     fi
131 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)
132
+    # swift through the s3 api.
137 133
     keystone user-role-add \
138 134
         --tenant_id $SERVICE_TENANT \
139 135
         --user_id $NOVA_USER \
... ...
@@ -255,6 +256,10 @@ if [[ "$ENABLED_SERVICES" =~ "ceilometer" ]]; then
255 255
     keystone user-role-add --tenant_id $SERVICE_TENANT \
256 256
                            --user_id $CEILOMETER_USER \
257 257
                            --role_id $ADMIN_ROLE
258
+    # Ceilometer needs ResellerAdmin role to access swift account stats.
259
+    keystone user-role-add --tenant_id $SERVICE_TENANT \
260
+                           --user_id $CEILOMETER_USER \
261
+                           --role_id $RESELLER_ROLE
258 262
     if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
259 263
         CEILOMETER_SERVICE=$(get_id keystone service-create \
260 264
             --name=ceilometer \