1 heat_template_version: 2013-05-23
4 A template implementation of a resource that provides a Wordpress blog server
9 description: Rackspace Cloud Server flavor
11 default: 1GB Standard Instance
14 - 512MB Standard Instance
15 - 1GB Standard Instance
16 - 2GB Standard Instance
17 - 4GB Standard Instance
18 - 8GB Standard Instance
19 - 15GB Standard Instance
20 - 30GB Standard Instance
21 description: must be a valid Rackspace Cloud Server flavor.
24 description: the instance name
26 default: Wordpress Webserver
29 description: Nova keypair name for ssh access to the server
33 description: The database hostname
39 description: The WordPress database name
45 description: must be from 1 to 64 characters
46 - allowed_pattern: "[a-zA-Z][a-zA-Z0-9]*"
47 description: must begin with a letter and contain only alphanumeric characters.
52 description: The WordPress database admin account username
58 description: must be from 1 to 16 characters
59 - allowed_pattern: "[a-zA-Z][a-zA-Z0-9]*"
60 description: must begin with a letter and contain only alphanumeric characters.
65 description: The WordPress database admin account password
71 description: must be between 1 and 41 characters
72 - allowed_pattern: "[a-zA-Z0-9]*"
73 description : must contain only alphanumeric characters.
78 type: "Rackspace::Cloud::Server"
80 flavor: { get_param: flavor }
81 # only tested on Fedora at the moment
82 image: fd8e4f18-9270-4f43-8932-c3719ae2f7fd # CentOS 6.5
83 name: { get_param: server_name }
84 key_name: { get_param: key_name }
89 yum -y install mysql-server httpd wordpress
90 sed -i "/Deny from All/d" /etc/httpd/conf.d/wordpress.conf
91 sed -i "s/Require local/Require all granted/" /etc/httpd/conf.d/wordpress.conf
92 sed --in-place --e "s/localhost/%dbhost%/" --e "s/database_name_here/%dbname%/" --e "s/username_here/%dbuser%/" --e "s/password_here/%dbpass%/" /usr/share/wordpress/wp-config.php
93 /etc/init.d/httpd start
95 /etc/init.d/mysqld start
98 CREATE DATABASE %dbname%;
99 GRANT ALL PRIVILEGES ON %dbname%.* TO "%dbuser%"@"localhost"
100 IDENTIFIED BY "%dbpass%";
104 iptables -I INPUT -p tcp --dport 80 -j ACCEPT
105 iptables-save > /etc/sysconfig/iptables
107 "%dbhost%": { get_param: db_host }
108 "%dbname%": { get_param: db_name }
109 "%dbuser%": { get_param: db_username }
110 "%dbpass%": { get_param: db_password }
115 value: { get_attr: [ wordpress, accessIPv4 ] }
116 description: The public ip address of the server
119 value: { get_attr: [ wordpress, privateIPv4 ] }
120 description: The private ip address of the server
125 template: http://%ip%/wordpress
127 "%ip%": { get_attr: [ wordpress, accessIPv4 ] }
128 description: URL for Wordpress wiki