update comment in the template
[heat-templates.git] / staging / wordpress-single-winserver.template
blob200a8b83b580285a59516565368946e8540bf05e
1 heat_template_version: 2013-05-23
3 description: |
4   HEAT template for installing Wordpress on Windows Server
6 parameters:
8   server_hostname:
9     type: string
10     default: HeatWinResource
11     description: Windows Server Name
12     constraints:
13     - length:
14         min: 1
15         max: 64
16     - allowed_pattern: "[a-zA-Z][a-zA-Z0-9]*"
17       description: must begin with a letter and contain only alphanumeric characters.
18     
19   image:
20     type: string
21     default: Windows Server 2012
22     description: Windows Server Image
23   
24   flavor:
25     type: string
26     description: Rackspace Cloud Server flavor
27     default: 4GB Standard Instance
28     constraints:
29     - allowed_values:
30       - 4GB Standard Instance
31       - 8GB Standard Instance
32       - 15GB Standard Instance
33       - 30GB Standard Instance
34       description: must be a valid Rackspace Cloud Server flavor.
35   
36   db_name:
37     type: string
38     default: wordpress
39     description: The WordPress database name
40     constraints:
41     - length:
42         min: 1
43         max: 64
44     - allowed_pattern: "[a-zA-Z][a-zA-Z0-9]*"
45       description: must begin with a letter and contain only alphanumeric characters.
46   
47   db_password:
48     type: string
49     default: verybadpass_123
50     description: Database password
51     
52   db_admin_password:
53     type: string
54     default: verybadpass_123
55     description: Database Admin password
58 resources:
60   rs_windows_server:
61     type: "Rackspace::Cloud::WinServer"
62     properties:
63       name: { get_param: server_hostname }
64       flavor: { get_param: flavor }
65       image: { get_param: image }
66       user_data:
67         str_replace:
68           template: |
69             $source = "http://download.microsoft.com/download/7/0/4/704CEB4C-9F42-4962-A2B0-5C84B0682C7A/WebPlatformInstaller_amd64_en-US.msi"
70             $destination = "webpi.msi"
71             $wc = New-Object System.Net.WebClient
72             $wc.DownloadFile($source, $destination)
73             Start-Process msiexec -ArgumentList "/i webpi.msi /qn"  -NoNewWindow -Wait
74             echo DBPassword[@]%dbpassword% DBAdminPassword[@]%dbadminpassword% > test.app
75             $tmpprofile = $env:userprofile
76             $env:userprofile = "c:\users\administrator"
77             $wpicmd = "C:\Program Files\Microsoft\Web Platform Installer\WebPICMD.exe"
78             Start-Process $wpicmd -ArgumentList "/Install /Application:Wordpress@test.app /MySQLPassword:%dbadminpassword% /AcceptEULA /Log:.\wpi.log"  -NoNewWindow -Wait
79             $env:userprofile = $tmpprofile
80           params:
81             "%dbpassword%": { get_param: db_password }
82             "%dbadminpassword%": { get_param: db_admin_password }
85 outputs:
87   public_ip:
88     value: { get_attr: [ rs_windows_server, accessIPv4 ] }
89     description: public IP of the windows server
90   
91   website_url:
92     value:
93       str_replace:
94         template: http://%ip%/wordpress
95         params:
96           "%ip%": { get_attr: [ rs_windows_server, accessIPv4 ] }
97     description: URL for Wordpress site