1 heat_template_version: 2013-05-23
4 HEAT template for deploying a single-node wordpress application on Rackspace
5 Cloud using Windows Cloud Servers, and Cloud Databases.
10 description: flavor id for the web server instances
12 default: 4GB Standard Instance
15 - 4GB Standard Instance
16 - 8GB Standard Instance
17 - 15GB Standard Instance
18 - 30GB Standard Instance
19 description: must be a valid Rackspace Cloud Server flavor.
23 default: Windows Server 2012
24 description: Windows Server Image
27 description: base name for the web server instances
29 default: Wordpress Webserver
33 description: the name for the wordpress database
39 description: must be between 1 and 64 characters
40 - allowed_pattern: "[a-zA-Z][a-zA-Z0-9]*"
41 description: must begin with a letter and contain only alphanumeric characters.
46 description: wordpress database admin account username
52 description: must be between 1 and 16 characters
53 - allowed_pattern: "[a-zA-Z][a-zA-Z0-9]*"
54 description: must begin with a letter and contain only alphanumeric characters.
59 description: wordpress database admin account password
65 description: must be between 1 and 14 characters
66 - allowed_pattern: "[a-zA-Z0-9]*"
67 description : must contain only alphanumeric characters.
70 description: wordpress database instance size
80 description: must be a valid cloud database flavor
83 description : wordpress database volume size (in GB)
90 description: must be between 1 and 1024 GB
93 description: the database instance name
100 type: "Rackspace::Cloud::WinServer"
102 name: { get_param: web_server_name }
103 flavor: { get_param: web_node_flavor }
104 image: { get_param: image }
108 $source = "http://download.microsoft.com/download/7/0/4/704CEB4C-9F42-4962-A2B0-5C84B0682C7A/WebPlatformInstaller_amd64_en-US.msi"
109 $destination = "webpi.msi"
110 $wc = New-Object System.Net.WebClient
111 $wc.DownloadFile($source, $destination)
112 Start-Process msiexec -ArgumentList "/i webpi.msi /qn" -NoNewWindow -Wait
113 echo "AppPath[@]Default Web Site/wordpress" > wp.app
114 echo "DbServer[@]%dbhost%" >> wp.app
115 echo "DbName[@]%dbname%" >> wp.app
116 echo "DbUsername[@]%dbuser%" >> wp.app
117 echo "DbPassword[@]%dbpassword%" >> wp.app
118 echo "DbAdminUsername[@]%dbuser%" >> wp.app
119 echo "DbAdminPassword[@]%dbpassword%" >> wp.app
120 $tmpprofile = $env:userprofile
121 $env:userprofile = "c:\users\administrator"
122 $wpicmd = "C:\Program Files\Microsoft\Web Platform Installer\WebPICMD.exe"
123 Start-Process $wpicmd -ArgumentList "/Install /Application:Wordpress@wp.app /MySQLPassword:%dbpassword% /AcceptEULA /Log:.\wpi.log" -NoNewWindow -Wait
124 $env:userprofile = $tmpprofile
126 "%dbhost%": { get_attr: [ db, hostname ] }
127 "%dbname%": { get_param: db_name }
128 "%dbuser%": { get_param: db_username }
129 "%dbpassword%": { get_param: db_password }
132 type: OS::Trove::Instance
134 name: { get_param: db_instance_name }
135 flavor: { get_param: db_flavor }
136 size: { get_param: db_volume_size }
138 - name: { get_param: db_username }
139 password: { get_param: db_password }
141 - { get_param: db_name }
143 - name: { get_param: db_name }
150 template: http://%ip%/wordpress
152 "%ip%": { get_attr: [ web_node, accessIPv4 ] }
153 description: Public URL for the wordpress blog