]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Updated WordPress_Single_Instance.template to work properly.
authorSteven Dake <sdake@redhat.com>
Tue, 17 Apr 2012 14:12:21 +0000 (07:12 -0700)
committerSteven Dake <sdake@redhat.com>
Tue, 17 Apr 2012 14:12:21 +0000 (07:12 -0700)
Signed-off-by: Steven Dake <sdake@redhat.com>
templates/WordPress_Single_Instance.template

index 063602bc44985eed2cbbd27bb94d3d05dca85e98..a69177828589f43d7985cc8fd78df0658144bed0 100644 (file)
@@ -1,7 +1,7 @@
 {
   "AWSTemplateFormatVersion" : "2010-09-09",
 
-  "Description" : "AWS CloudFormation Sample Template WordPress_Single_Instance: WordPress is web software you can use to create a beautiful website or blog. This template installs a single-instance WordPress deployment using a local MySQL database to store the data.",
+  "Description" : "AWS CloudFormation Sample Template WordPress_Multi_Instance: WordPress is web software you can use to create a beautiful website or blog. This template installs two instances: one running a WordPress deployment and the other using a local MySQL database to store the data.",
 
   "Parameters" : {
 
   },
 
   "Resources" : {
-
-    "WebServer": {
+    "WikiDatabase": {
       "Type": "AWS::EC2::Instance",
       "Metadata" : {
         "AWS::CloudFormation::Init" : {
           "config" : {
             "packages" : {
               "yum" : {
-                "httpd"        : [],
                 "mysql"        : [],
                 "mysql-server" : [],
+                "httpd"        : [],
                 "wordpress"    : []
               }
             },
             "services" : {
               "systemd" : {
-                "httpd"    : { "enabled" : "true", "ensureRunning" : "true" },
-                "mysqld"   : { "enabled" : "true", "ensureRunning" : "true" }
+                "mysqld"   : { "enabled" : "true", "ensureRunning" : "true" },
+                "httpd"    : { "enabled" : "true", "ensureRunning" : "true" }
               }
             }
           }
           "/opt/aws/bin/cfn-init\n",
           "# Setup MySQL root password and create a user\n",
           "mysqladmin -u root password '", { "Ref" : "DBRootPassword" }, "'\n",
-          "cat >> /tmp/mysql-wordpress-config << EOF\n",
+          "cat << EOF | mysql -u root --password='", { "Ref" : "DBRootPassword" }, "'\n",
           "CREATE DATABASE ", { "Ref" : "DBName" }, ";\n",
           "GRANT ALL PRIVILEGES ON ", { "Ref" : "DBName" }, ".* TO \"", { "Ref" : "DBUsername" }, "\"@\"localhost\"\n",
           "IDENTIFIED BY \"", { "Ref" : "DBPassword" }, "\";\n",
           "FLUSH PRIVILEGES;\n",
           "EXIT\n",
           "EOF\n",
-          "cat /tmp/mysql-wordpress-config | mysql -u root --password='", { "Ref" : "DBRootPassword" }, "' < /tmp/mysql-wordpress-config\n",
-          "sed --in-place --e s/database_name_here/", { "Ref" : "DBName" }, "/ --e s/username_here/", { "Ref" : "DBUsername" }, "/ --e s/password_here/", { "Ref" : "DBPassword" }, "/ /usr/share/wordpress/wp-config.php\n",
-          "cp /usr/share/wordpress/wp-config.php /usr/share/wordpress/wp-config.orig\n"
+          "sed --in-place --e s/database_name_here/", { "Ref" : "DBName" }, "/ --e s/username_here/", { "Ref" : "DBUsername" }, "/ --e s/password_here/", { "Ref" : "DBPassword" }, "/ /usr/share/wordpress/wp-config.php\n"
         ]]}}
       }
-    }
+    },
   },
 
   "Outputs" : {