DSCResources/QlikRimNode/QlikRimNode.schema.psm1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
Configuration QlikRimNode
{
  param (
    [PSCredential] $SenseService,
    [PSCredential] $QlikAdmin,
    [string] $ProductName,
    [string] $SetupPath,
    [string] $PatchPath,
    [string] $DbHost,
    [PSCredential] $DbCredential,
    [string] $Hostname = ([System.Net.Dns]::GetHostEntry('localhost')).hostname,
    [bool]$ConfigureLogging = $true,
    [PSCredential]$QLogsWriterPassword,
    [PSCredential]$QLogsReaderPassword,
    [string]$QLogsHostname,
    [int]$QLogsPort = 4432,
    [bool] $Engine,
    [bool] $Printing,
    [bool] $Proxy,
    [bool] $Scheduler,
    [bool] $ApplyCommon,
    [string] $CentralNode
  )

  Import-DscResource -ModuleName PSDesiredStateConfiguration, QlikResources, xNetworking, xPSDesiredStateConfiguration

  if (-Not $DbCredential) {
    $DbCredential = New-Object System.Management.Automation.PSCredential('qliksenserepository', $SenseService.GetNetworkCredential().SecurePassword)
  }
  if (-Not $QLogsWriterPassword) {
    $QLogsWriterPassword = $SenseService
  }
  if (-Not $QLogsReaderPassword) {
    $QLogsReaderPassword = $SenseService
  }
  if (-Not $DbHost) {
    $DbHost = $CentralNode
  }
  if (-Not $QLogsHostname) {
    $QLogsHostname = $DbHost
  }
  if (-Not $QlikAdmin) {
    $QlikAdmin = $SenseService
  }

  QlikPackage Sense_Setup
  {
      Name = $ProductName
      Setup = $SetupPath
      Patch = $PatchPath
      #PsDscRunAsCredential = $SenseService
      ServiceCredential = $SenseService
      DbCredential = $DbCredential
      DbHost = $DbHost
      Hostname = $Hostname
      JoinCluster = $true
      ConfigureLogging = $ConfigureLogging
      QLogsWriterPassword = $QLogsWriterPassword
      QLogsReaderPassword = $QLogsReaderPassword
      QLogsHostname = $QLogsHostname
      QLogsPort = $QLogsPort
      Ensure = 'Present'
  }

  xFirewall Qlik-Cert
  {
    Name                  = "Qlik-Cert"
    DisplayName           = "Qlik Sense Certificate Distribution"
    Group                 = "Qlik Sense"
    Ensure                = "Present"
    Action                = "Allow"
    Enabled               = "True"
    Profile               = ("Domain", "Private", "Public")
    Direction             = "InBound"
    LocalPort             = ("4444")
    Protocol              = "TCP"
  }

  xFirewall QRS
  {
      Name                  = "QRS"
      DisplayName           = "Qlik Sense Repository Service"
      Group                 = "Qlik Sense"
      Ensure                = "Present"
      Action                = "Allow"
      Enabled               = "True"
      Profile               = ("Domain", "Private", "Public")
      Direction             = "InBound"
      LocalPort             = ("4242")
      Protocol              = "TCP"
  }

  xService QRS
  {
    Name = "QlikSenseRepositoryService"
    State = "Running"
    DependsOn = "[QlikPackage]Sense_Setup"
  }

  xService QPR
  {
    Name = "QlikSensePrintingService"
    State = "Running"
    DependsOn = "[xService]QRS"
  }

  xService QSS
  {
    Name = "QlikSenseSchedulerService"
    State = "Running"
    DependsOn = "[xService]QRS"
  }

  xService QES
  {
    Name = "QlikSenseEngineService"
    State = "Running"
    DependsOn = "[xService]QRS"
  }

  xService QPS
  {
    Name = "QlikSenseProxyService"
    State = "Running"
    DependsOn = "[xService]QRS"
  }

  xService QSD
  {
    Name = "QlikSenseServiceDispatcher"
    State = "Running"
    DependsOn = "[xService]QRS"
  }

  QlikConnect SenseCentral
  {
    Computername  = $CentralNode
    Username      = $QlikAdmin.UserName
    TrustAllCerts = $true
    DependsOn     = "[xService]QPS"
  }

  QlikNode $(hostname)
  {
    Ensure    = "Present"
    HostName  = $(hostname)
    Engine    = $Engine
    Printing  = $Printing
    Proxy     = $Proxy
    Scheduler = $Scheduler
    DependsOn = "[xFirewall]Qlik-Cert", "[QlikConnect]SenseCentral"
  }
}