]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
heat templates : Align AutoScaling template with cfntools
authorSteven Hardy <shardy@redhat.com>
Fri, 2 Nov 2012 08:57:52 +0000 (08:57 +0000)
committerSteven Hardy <shardy@redhat.com>
Fri, 2 Nov 2012 08:59:38 +0000 (08:59 +0000)
Updated cfntools require authentication for cfn-push-stats,
so the AutoScaling template needs the user/key and boto.cfg
additions, same as in the HA templates, otherwise cfn-push-stats,
and hence autoscaling doesn't work

Change-Id: Ib3ef4a932bb656f29e25ef745409f5fe3e82c356
Signed-off-by: Steven Hardy <shardy@redhat.com>
templates/AutoScalingMultiAZSample.template

index 3cef664b737ed9e7d3f863276b8f6889895f4ea2..abe8aca0191f3df4fa5f34d12c1e62cf62480918 100644 (file)
   },
 
   "Resources" : {
+    "CfnUser" : {
+      "Type" : "AWS::IAM::User"
+    },
+    "WebServerKeys" : {
+      "Type" : "AWS::IAM::AccessKey",
+      "Properties" : {
+        "UserName" : {"Ref": "CfnUser"}
+      }
+    },
     "WebServerGroup" : {
       "Type" : "AWS::AutoScaling::AutoScalingGroup",
       "Properties" : {
         "AWS::CloudFormation::Init" : {
           "config" : {
             "files" : {
+              "/etc/cfn/cfn-credentials" : {
+                "content" : { "Fn::Join" : ["", [
+                  "AWSAccessKeyId=", { "Ref" : "WebServerKeys" }, "\n",
+                  "AWSSecretKey=", {"Fn::GetAtt": ["WebServerKeys",
+                                    "SecretAccessKey"]}, "\n"
+                ]]},
+                "mode"    : "000400",
+                "owner"   : "root",
+                "group"   : "root"
+              },
               "/tmp/setup.mysql" : {
                 "content" : { "Fn::Join" : ["", [
                 "CREATE DATABASE ", { "Ref" : "DBName" }, ";\n",
           " -r LaunchConfig ",
           " --region ", { "Ref" : "AWS::Region" }, "\n",
 
+          "# Update boto config (template created by heat-jeos tdl)\n",
+          "sed -i \"s/__GATEWAY_IP__/",
+          "$(/sbin/ip route | grep \"^default\" | awk '{print $3}')/\"",
+          " /etc/boto.cfg \n",
+
           "# Setup MySQL root password and create a user\n",
           "mysqladmin -u root password '", { "Ref" : "DBRootPassword" }, "'\n",