update comment in the template
[heat-templates.git] / dev / winwordpress_cloudbackup.template
bloba2c6493fdaef1f3101731daeb127ab917eec2019
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.
19   image:
20     type: string
21     default: Windows Server 2012
22     description: Windows Server Image
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.
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.
47   db_password:
48     type: string
49     default: verybadpass_123
50     description: Database password
52   db_admin_password:
53     type: string
54     default: verybadpass_123
55     description: Database Admin password
58 resources:
60   rax_backup_config:
61     properties:
62       BackupConfigurationName: wordpressbackup
63       DayOfWeekId: null
64       Frequency: Hourly
65       StartTimeHour: null
66       StartTimeMinute: null
67       StartTimeAmPm: null
68       HourInterval: 1
69       IsActive: true
70       Enabled: true
71       NotifyFailure: true
72       NotifyRecipients: username@domain.com
73       NotifySuccess: false
74       TimeZoneId: Eastern Standard Time
75       VersionRetention: 60
76       host_ip_address: { get_attr: [rs_windows_server, accessIPv4] }
77       Inclusions:
78       - {"FilePath": "c:\\inetpub\\wwwroot\\wordpress", "FileItemType": "Folder" }
79     type: Rackspace::Cloud::BackupConfig
81   rs_windows_server:
82     type: "Rackspace::Cloud::WinServer"
83     properties:
84       name: { get_param: server_hostname }
85       flavor: { get_param: flavor }
86       image: { get_param: image }
87       metadata: {build_config: backup_agent_only}
88       user_data:
89         str_replace:
90           template: |
91             $source = "http://download.microsoft.com/download/7/0/4/704CEB4C-9F42-4962-A2B0-5C84B0682C7A/WebPlatformInstaller_amd64_en-US.msi"
92             $destination = "webpi.msi"
93             $wc = New-Object System.Net.WebClient
94             $wc.DownloadFile($source, $destination)
95             Start-Process msiexec -ArgumentList "/i webpi.msi /qn"  -NoNewWindow -Wait
96             echo DBPassword[@]%dbpassword% DBAdminPassword[@]%dbadminpassword% > test.app
97             $tmpprofile = $env:userprofile
98             $env:userprofile = "c:\users\administrator"
99             $wpicmd = "C:\Program Files\Microsoft\Web Platform Installer\WebPICMD.exe"
100             Start-Process $wpicmd -ArgumentList "/Install /Application:Wordpress@test.app /MySQLPassword:%dbadminpassword% /AcceptEULA /Log:.\wpi.log"  -NoNewWindow -Wait
101             $env:userprofile = $tmpprofile
102           params:
103             "%dbpassword%": { get_param: db_password }
104             "%dbadminpassword%": { get_param: db_admin_password }
107 outputs:
109   public_ip:
110     value: { get_attr: [ rs_windows_server, accessIPv4 ] }
111     description: public IP of the windows server
113   website_url:
114     value:
115       str_replace:
116         template: http://%ip%/wordpress
117         params:
118           "%ip%": { get_attr: [ rs_windows_server, accessIPv4 ] }
119     description: URL for Wordpress site