Add "heat_instance" role which we will assign all "instance users"
to in the engine when we create them
Ref #279
Change-Id: If7cc07c605f7696c1e9f617dbfca1b81d5b04196
Signed-off-by: Steven Hardy <shardy@redhat.com>
fi
}
+create_role() {
+ local role_name=$1
+
+ role_id=$(get_data 2 $role_name 1 keystone role-list)
+ if [ -n "$role_id" ]
+ then
+ echo "Role $role_name already exists : $role_id" >&2
+ else
+ keystone role-create --name $role_name
+ fi
+}
+
get_endpoint() {
local service_type=$1
echo HEAT_USERID $HEAT_USERID
add_role $HEAT_USERID $SERVICE_TENANT $ADMIN_ROLE $HEAT_USERNAME
+# Create a special role which "instance users" are assigned to
+INSTANCE_ROLE="heat_instance"
+create_role $INSTANCE_ROLE
+
HEAT_CFN_SERVICE=$(get_service heat-cfn cloudformation \
"Heat CloudFormation API")
add_endpoint $HEAT_CFN_SERVICE 'http://localhost:8000/v1'