From: Angus Salkeld Date: Thu, 15 Mar 2012 02:43:15 +0000 (+1100) Subject: Simplify the template more. X-Git-Tag: 2014.1~2214 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=83ba8d951939fe03329c388d614102e73a571a7e;p=openstack-build%2Fheat-build.git Simplify the template more. Signed-off-by: Angus Salkeld --- diff --git a/templates/WordPress_Single_Instance.template b/templates/WordPress_Single_Instance.template index f77c877b..9a67ebaf 100644 --- a/templates/WordPress_Single_Instance.template +++ b/templates/WordPress_Single_Instance.template @@ -51,6 +51,7 @@ }, "DBRootPassword": { + "Default": "admin", "NoEcho": "true", "Description" : "Root password for MySQL", "Type": "String", @@ -87,28 +88,6 @@ "Resources" : { - "CfnUser" : { - "Type" : "AWS::IAM::User", - "Properties" : { - "Path": "/", - "Policies": [{ - "PolicyName": "root", - "PolicyDocument": { "Statement":[{ - "Effect":"Allow", - "Action":"cloudformation:DescribeStackResource", - "Resource":"*" - }]} - }] - } - }, - - "HostKeys" : { - "Type" : "AWS::IAM::AccessKey", - "Properties" : { - "UserName" : {"Ref": "CfnUser"} - } - }, - "WebServer": { "Type": "AWS::EC2::Instance", "Metadata" : { @@ -117,66 +96,15 @@ "packages" : { "yum" : { "httpd" : [], - "php" : [], - "php-mysql" : [], "mysql" : [], "mysql-server" : [], - "mysql-devel" : [], - "mysql-libs" : [] - } - }, - - "sources" : { - "/var/www/html" : "http://wordpress.org/latest.tar.gz" - }, - - "files" : { - "/tmp/setup.mysql" : { - "content" : { "Fn::Join" : ["", [ - "CREATE DATABASE ", { "Ref" : "DBName" }, ";\n", - "CREATE USER '", { "Ref" : "DBUsername" }, "'@'localhost' IDENTIFIED BY '", { "Ref" : "DBPassword" }, "';\n", - "GRANT ALL ON ", { "Ref" : "DBName" }, ".* TO '", { "Ref" : "DBUsername" }, "'@'localhost';\n", - "FLUSH PRIVILEGES;\n" - ]]}, - "mode" : "000644", - "owner" : "root", - "group" : "root" - }, - - "/var/www/html/wordpress/wp-config.php" : { - "content" : { "Fn::Join" : ["", [ - "g]4ll6~,6G|R');\n", - "define('SECURE_AUTH_KEY', 'gTFTI|~rYHY)|mlu:Cv7RN]GQ^3ngyUbw;L0o!12]0c-ispR<-yt3qj]xjquz^&9');\n", - "define('LOGGED_IN_KEY', 'Jd:HG9M)1p5t2v6uF~D`,.o1pzS)F8[bM9i[');\n", - "define('LOGGED_IN_SALT', '~K;rSQ^+{P5/k|=!]k%RXAF-Y@XMY6GSp+wJ5{(|rCzaWjZ%/');\n", - "define('NONCE_SALT', ',Bs_*Y9:b/1Z:apVLHtz35uim|okkA,b|Jt[-&Nla=T{> /tmp/mysql-wordpress-config << EOF\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", + "systemctl stop mysqld.service\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" ]]}} } - }, - - "WaitHandle" : { - "Type" : "AWS::CloudFormation::WaitConditionHandle" - }, - - "WaitCondition" : { - "Type" : "AWS::CloudFormation::WaitCondition", - "DependsOn" : "WebServer", - "Properties" : { - "Handle" : {"Ref" : "WaitHandle"}, - "Timeout" : "300" - } - }, - - "WebServerSecurityGroup" : { - "Type" : "AWS::EC2::SecurityGroup", - "Properties" : { - "GroupDescription" : "Enable HTTP access via port 80 and SSH access", - "SecurityGroupIngress" : [ - {"IpProtocol" : "tcp", "FromPort" : "80", "ToPort" : "80", "CidrIp" : "0.0.0.0/0"}, - {"IpProtocol" : "tcp", "FromPort" : "22", "ToPort" : "22", "CidrIp" : "0.0.0.0/0"} - ] - } - } - }, - - "Outputs" : { - "WebsiteURL" : { - "Value" : { "Fn::Join" : ["", ["http://", { "Fn::GetAtt" : [ "WebServer", "PublicDnsName" ]}, "/wordpress"]] }, - "Description" : "WordPress Website" } } }