update comment in the template
[heat-templates.git] / prod / qlikview.template
blob225c9a8836cdeda9bcc8fd6aa03c033d691a1e7b
1 heat_template_version: 2013-05-23
3 description: |
4   HEAT template for installing qlikview 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 2008 R2 SP1
22     description: Windows Server Image
23     constraints:
24     - allowed_values:
25       - Windows Server 2008 R2 SP1
26       - Windows Server 2008 R2 SP1 + SQL Server 2008 R2 SP2 Web
27       description: must be a valid windows server OS.
28   
29   flavor:
30     type: string
31     description: Rackspace Cloud Server flavor
32     default: 4GB Standard Instance
33     constraints:
34     - allowed_values:
35       - 4GB Standard Instance
36       - 8GB Standard Instance
37       - 15GB Standard Instance
38       - 30GB Standard Instance
39       description: must be a valid Rackspace Cloud Server flavor.
40   
41 resources:
43   rs_windows_server:
44     type: "Rackspace::Cloud::WinServer"
45     properties:
46       name: { get_param: server_hostname }
47       flavor: { get_param: flavor }
48       image: { get_param: image }
49       user_data: |
50         $BaseURL = "http://304548e3a421cc29c822-f6518816eb9cdc30b28dfdf16d2d7417.r95.cf1.rackcdn.com/"
51         #$InstallFile = "QlikViewDesktop_x64Setup.exe"
52         $InstallFile = "QlikViewX64.msi"
53         $AutomationPath = "C:\windows"
54         $log = ".\quikview.log"
55         # Download Function
56         Function Download-File ($DowloadUrl, $DestinationFileName) {
57           $WebClientObject = New-Object System.Net.WebClient
58           try {
59             Write-Host $DestinationFileName
60             Write-Host $DowloadUrl
61             $WebClientObject.DownloadFile($DowloadUrl, $DestinationFileName)
62             "[$(Get-Date)] Status: Downloaded $DestinationFileName Successfully"
63           }
64           catch{
65             "[*] Installation ERROR"
66           }
67         }
68         # Install MSI Function
69         Function InstallMSI ($MSIFileName, $BuildLog){
70           write-host "[$(Get-Date)] Status: Installing $MSIFileName"
71           $BuildArgs = @{
72             FilePath = "msiexec"
73             ArgumentList = "/quiet /passive /i " +  $MSIFileName
74             RedirectStandardOutput = $BuildLog
75             Wait = $true
76           }
77           Try {
78             # Install the agent
79             Write-Host @BuildArgs
80             Start-Process @BuildArgs
81           }
82           Catch {
83             #"Error installing $MSIFileName : $_" | Add-Content $BuildLog
84             #$failure = $true
85             throw "Error: Failed to install $MSIFileName : $_"
86           }
87           Write-host "[$(Get-Date)] Status: Successfully Installed $MSIFileName"
88         }
89         # Main
90         Download-File $BaseURL$InstallFile $AutomationPath"\"$InstallFile
91         InstallMSI $InstallFile $log
93 outputs:
95   public_ip:
96     value: { get_attr: [ rs_windows_server, accessIPv4 ] }
97     description: public IP of the windows server
98