Add support to optionally launch the heat service.

This allows the heat service to be started as a devstack service.

Heat is disabled by default, and can be enabled with this in your localrc:
ENABLED_SERVICES+=,heat

There is now a repo of heat-enabled images here:
https://github.com/heat-api/prebuilt-jeos-images/downloads

These can be added to the IMAGE_URLS in your localrc.

After devstack is launched, a template can be invoked with:
nova keypair-add --pub_key $HOME/.ssh/id_rsa.pub heat_key
heat -d create wordpress \
--template-file=../heat/templates/WordPress_Single_Instance.template \
--parameters="InstanceType=m1.tiny;DBUsername=wpuser;DBPassword=wppassword;\
KeyName=heat_key;LinuxDistribution=F16"

Change-Id: I07591295eb2b9eb7868b1577dd3c24b19812a689
diff --git a/files/keystone_data.sh b/files/keystone_data.sh
index 6987797..2a8d070 100755
--- a/files/keystone_data.sh
+++ b/files/keystone_data.sh
@@ -10,6 +10,7 @@
 # service              quantum   admin        # if enabled
 # service              swift     admin        # if enabled
 # service              cinder    admin        # if enabled
+# service              heat      admin        # if enabled
 # demo                 admin     admin
 # demo                 demo      Member, anotherrole
 # invisible_to_admin   demo      Member
@@ -154,6 +155,29 @@
     fi
 fi
 
+# Heat
+if [[ "$ENABLED_SERVICES" =~ "heat" ]]; then
+    HEAT_USER=$(get_id keystone user-create --name=heat \
+                                              --pass="$SERVICE_PASSWORD" \
+                                              --tenant_id $SERVICE_TENANT \
+                                              --email=heat@example.com)
+    keystone user-role-add --tenant_id $SERVICE_TENANT \
+                           --user_id $HEAT_USER \
+                           --role_id $ADMIN_ROLE
+    if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
+        HEAT_SERVICE=$(get_id keystone service-create \
+            --name=heat \
+            --type=orchestration \
+            --description="Heat Service")
+        keystone endpoint-create \
+            --region RegionOne \
+            --service_id $HEAT_SERVICE \
+            --publicurl "http://$SERVICE_HOST:$HEAT_API_PORT/v1" \
+            --adminurl "http://$SERVICE_HOST:$HEAT_API_PORT/v1" \
+            --internalurl "http://$SERVICE_HOST:$HEAT_API_PORT/v1"
+    fi
+fi
+
 # Glance
 if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then
     GLANCE_USER=$(get_id keystone user-create \
@@ -296,3 +320,4 @@
             --internalurl "http://$SERVICE_HOST:8776/v1/\$(tenant_id)s"
     fi
 fi
+