1 heat_template_version: 2013-05-23
4 HEAT template for deploying a single-node wordpress deployment on Rackspace Cloud
5 using Cloud Server, and Cloud Database.
10 description: flavor id for the web server instances
12 default: 1GB Standard Instance
15 - 512MB Standard Instance
16 - 1GB Standard Instance
17 - 2GB Standard Instance
18 - 4GB Standard Instance
19 - 8GB Standard Instance
20 - 15GB Standard Instance
21 - 30GB Standard Instance
22 description: must be a valid Rackspace Cloud Server flavor.
25 description: base name for the web server instances
27 default: Wordpress Webserver
30 description: nova keypair to use for ssh access to the web nodes
35 description: the name for the wordpress database
41 description: must be between 1 and 64 characters
42 - allowed_pattern: "[a-zA-Z][a-zA-Z0-9]*"
43 description: must begin with a letter and contain only alphanumeric characters.
48 description: wordpress database admin account username
54 description: must be between 1 and 16 characters
55 - allowed_pattern: "[a-zA-Z][a-zA-Z0-9]*"
56 description: must begin with a letter and contain only alphanumeric characters.
61 description: wordpress database admin account password
67 description: must be between 1 and 14 characters
68 - allowed_pattern: "[a-zA-Z0-9]*"
69 description : must contain only alphanumeric characters.
72 description: wordpress database instance size
82 description: must be a valid cloud database flavor
85 description : wordpress database volume size (in GB)
92 description: must be between 1 and 1024 GB
95 description: the database instance name
102 type: Rackspace::Cloud::Server
104 flavor: { get_param: web_node_flavor }
105 image: fd8e4f18-9270-4f43-8932-c3719ae2f7fd # CentOS 6.5
106 name: { get_param: web_server_name }
107 key_name: { get_param: key_name }
112 yum -y install mysql httpd wordpress
113 sed -i "/Deny from All/d" /etc/httpd/conf.d/wordpress.conf
114 sed -i "s/Require local/Require all granted/" /etc/httpd/conf.d/wordpress.conf
115 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
116 /etc/init.d/httpd start
118 iptables -I INPUT -p tcp --dport 80 -j ACCEPT
119 iptables-save > /etc/sysconfig/iptables
121 "%dbhost%": { get_attr: [ db, hostname ] }
122 "%dbname%": { get_param: db_name }
123 "%dbuser%": { get_param: db_username }
124 "%dbpass%": { get_param: db_password }
127 type: OS::Trove::Instance
129 name: { get_param: db_instance_name }
130 flavor: { get_param: db_flavor }
131 size: { get_param: db_volume_size }
133 - name: { get_param: db_username }
134 password: { get_param: db_password }
136 - { get_param: db_name }
138 - name: { get_param: db_name }
145 template: "http://%ip%/wordpress"
147 "%ip%": { get_attr: [ php_app, accessIPv4 ] }
148 description: Public URL for the wordpress blog