1 heat_template_version: 2013-05-23
4 HEAT template for deploying a multi-node wordpress deployment on Rackspace Cloud
5 using Cloud Servers, Cloud Load Balancers and Cloud Databases. This version uses
6 a user-defined template resource to specify the implementation of the web-heads
11 description: flavor for the web server instances
13 default: 4GB Standard Instance
16 - 4GB Standard Instance
17 - 8GB Standard Instance
18 - 15GB Standard Instance
19 - 30GB Standard Instance
20 description: must be a valid Rackspace Cloud Server flavor.
24 default: Windows Server 2012
25 description: Windows Server Image
28 description: base name for the web server instances
30 default: Wordpress Webserver
34 description: the name for the wordpress database
40 description: must be between 1 and 64 characters
41 - allowed_pattern: "[a-zA-Z][a-zA-Z0-9]*"
42 description: must begin with a letter and contain only alphanumeric characters.
47 description: wordpress database admin account username
53 description: must be between 1 and 16 characters
54 - allowed_pattern: "[a-zA-Z][a-zA-Z0-9]*"
55 description: must begin with a letter and contain only alphanumeric characters.
60 description: wordpress database admin account password
66 description: must be between 1 and 14 characters
67 - allowed_pattern: "[a-zA-Z0-9]*"
68 description : must contain only alphanumeric characters.
71 description: wordpress database instance size
81 description: must be a valid cloud database flavor
84 description : wordpress database volume size (in GB)
91 description: must be between 1 and 1024 GB
94 description: the database instance name
99 description: valid domain name
104 description: domain owner email addresses
106 default: admin@example.com
109 description: domain record type
125 type: OS::Heat::ResourceGroup
129 type: Rackspace::Cloud::WinServer
131 name: { get_param: web_server_name }
132 flavor: { get_param: web_node_flavor }
133 image: { get_param: image }
137 $source = "http://download.microsoft.com/download/7/0/4/704CEB4C-9F42-4962-A2B0-5C84B0682C7A/WebPlatformInstaller_amd64_en-US.msi"
138 $destination = "webpi.msi"
139 $wc = New-Object System.Net.WebClient
140 $wc.DownloadFile($source, $destination)
141 Start-Process msiexec -ArgumentList "/i webpi.msi /qn" -NoNewWindow -Wait
142 echo "AppPath[@]Default Web Site/wordpress" > wp.app
143 echo "DbServer[@]%dbhost%" >> wp.app
144 echo "DbName[@]%dbname%" >> wp.app
145 echo "DbUsername[@]%dbuser%" >> wp.app
146 echo "DbPassword[@]%dbpassword%" >> wp.app
147 echo "DbAdminUsername[@]%dbuser%" >> wp.app
148 echo "DbAdminPassword[@]%dbpassword%" >> wp.app
149 $tmpprofile = $env:userprofile
150 $env:userprofile = "c:\users\administrator"
151 $wpicmd = "C:\Program Files\Microsoft\Web Platform Installer\WebPICMD.exe"
152 Start-Process $wpicmd -ArgumentList "/Install /Application:Wordpress@wp.app /MySQLPassword:%dbpassword% /AcceptEULA /Log:.\wpi.log" -NoNewWindow -Wait
153 $env:userprofile = $tmpprofile
155 "%dbhost%": { get_attr: [ db, hostname ] }
156 "%dbname%": { get_param: db_name }
157 "%dbuser%": { get_param: db_username }
158 "%dbpassword%": { get_param: db_password }
161 type: "Rackspace::Cloud::LoadBalancer"
165 template: lb-%server_name%
167 "%server_name%": { get_param: web_server_name }
169 - addresses: { get_attr: [ web_nodes, privateIPv4 ] }
174 algorithm: LEAST_CONNECTIONS
178 maxConnectionRate: 50
182 sessionPersistence: HTTP_COOKIE
190 attemptsBeforeDeactivation: 3
194 contentCaching: ENABLED
197 type: OS::Trove::Instance
199 name: { get_param: db_instance_name }
200 flavor: { get_param: db_flavor }
201 size: { get_param: db_volume_size }
203 - name: { get_param: db_username }
204 password: { get_param: db_password }
206 - { get_param: db_name }
208 - name: { get_param: db_name }
212 type: Rackspace::Cloud::DNS
214 name: { get_param: domain_name }
215 emailAddress: { get_param: email_address }
217 - name: { get_param: domain_name }
218 type: { get_param: domain_record_type }
219 data: { get_attr: [lb, PublicIp] }
220 - name: { get_param: domain_name }
222 data: dns1.stabletransit.com
223 - name: { get_param: domain_name }
225 data: dns2.stabletransit.com
232 template: http://%ip%/wordpress
234 "%ip%": { get_attr: [ lb, PublicIp ] }
235 description: Public URL for the wordpress blog
237 wordpress_domain_url:
240 template: "http://%domain%/wordpress"
242 "%domain%": { get_param: domain_name }
243 description: Public URL for the wordpress blog with domain name