From: Steven Dake Date: Tue, 17 Apr 2012 14:12:21 +0000 (-0700) Subject: Updated WordPress_Single_Instance.template to work properly. X-Git-Tag: 2014.1~1980 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=27832d617e34a1d6a290437a76e397526e039291;p=openstack-build%2Fheat-build.git Updated WordPress_Single_Instance.template to work properly. Signed-off-by: Steven Dake --- diff --git a/templates/WordPress_Single_Instance.template b/templates/WordPress_Single_Instance.template index 063602bc..a6917782 100644 --- a/templates/WordPress_Single_Instance.template +++ b/templates/WordPress_Single_Instance.template @@ -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" : { @@ -92,24 +92,23 @@ }, "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" } } } } @@ -125,19 +124,17 @@ "/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" : {