DSCResources/QlikCentral/QlikCentral.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
Configuration QlikCentral
{
  param (
    [PSObject]$License,
    [bool]$ApplyCommon = $true
  )
  Import-DSCResource -ModuleName xNetworking,xSmbShare,QlikResources

  if ($ApplyCommon) {
    QlikCommon Common
    {}
  }

  QlikLicense SiteLicense
  {
    Serial       = $License.Serial
    Control      = $License.Control
    Name         = $License.Name
    Organization = $License.Organization
    Lef          = $License.Lef
    Ensure       = "Present"
  }

  #QlikCustomProperty Role
  #{
  # Name = "Role"
  # ChoiceValues = "Proxy", "Engine", "Scheduler"
  # ObjectTypes = "ServerNodeConfiguration"
  # Ensure = "Present"
  # DependsOn = "[QlikLicense]SiteLicense"
  #}

  #if (Connect-Qlik -ErrorAction SilentlyContinue) {
  # QlikCustomProperty NodeAffinity
  # {
  # Name = "NodeAffinity"
  # ChoiceValues = @(Get-QlikNode -filter "@Role eq 'engine'" | foreach { $_.hostName })
  # ObjectTypes = ("App", "Stream")
  # Ensure = "Present"
  # DependsOn = "[QlikLicense]SiteLicense"
  # }
  #
  # if( (Get-QlikNode -filter "schedulerEnabled eq true" -count).value -gt 1 -And (Get-QlikNode -filter "isCentral eq true and @role eq scheduler") -eq $null ) {
  # QlikScheduler Central
  # {
  # Node = "Central"
  # SchedulerServiceType = "Master"
  # DependsOn = "[QlikDataConnection]ServerLogFolder", "[QlikDataConnection]ArchivedLogsFolder"
  # }
  # } else {
  # QlikScheduler Central
  # {
  # Node = "Central"
  # SchedulerServiceType = "Both"
  # }
  # }
  #}

  #QlikDataConnection ServerLogFolder
  #{
  # Name = "ServerLogFolder"
  # ConnectionString = "\\$CentralNode\QlikLog"
  # Type = "Folder"
  # Ensure = "Present"
  # DependsOn = "[xSmbShare]QlikLog", "[QlikLicense]SiteLicense"
  #}
  #
  #QlikDataConnection ArchivedLogsFolder
  #{
  # Name = "ArchivedLogsFolder"
  # ConnectionString = "\\$CentralNode\QlikArchiveLog"
  # Type = "Folder"
  # Ensure = "Present"
  # DependsOn = "[xSmbShare]QlikArchiveLog", "[QlikLicense]SiteLicense"
  #}

  #QlikRule ResourcesOnNonCentralNodes
  #{
  # Name = "ResourcesOnNonCentralNodes"
  # Disabled = $true
  # Ensure = "Present"
  # #DependsOn = "[QlikDataConnection]ServerLogFolder", "[QlikDataConnection]ArchivedLogsFolder"
  #}

  #QlikRule ResourcesOnSchedulers
  #{
  # Name = "ResourcesOnSchedulers"
  # Category = "sync"
  # Rule = '((node.@Role="Scheduler"))'
  # ResourceFilter = "App_*"
  # Ensure = "Present"
  # DependsOn = "[QlikCustomProperty]Role"
  #}

  #QlikRule ResourceNodeAffinity
  #{
  # Name = "ResourceNodeAffinity"
  # Category = "sync"
  # Actions = 1
  # Rule = '((resource.@NodeAffinity=node.name or resource.stream.@NodeAffinity=node.name) or (resource.@NodeAffinity.Empty() and resource.stream.@NodeAffinity.Empty()))'
  # ResourceFilter = "App_*"
  # Ensure = "Present"
  # DependsOn = "[QlikCustomProperty]NodeAffinity"
  #}

  QlikRule RootAccess
  {
    Name = "License rule to grant RootAdmin access"
    Rule = '((user.roles="RootAdmin"))'
    Category = "license"
    Actions = 1
    Comment = "Rule to setup automatic user access"
    #RuleContext = "hub"
    Ensure = "Present"
    DependsOn = "[QlikLicense]SiteLicense"
  }

  #xSmbShare QlikLog
  #{
  # Ensure = "Present"
  # Name = "QlikLog"
  # Path = "C:\ProgramData\Qlik\Sense\Log"
  # FullAccess = "Administrators"
  # Description = "Qlik Sense Scheduler access to central logs"
  #}
  #
  #xSmbShare QlikArchiveLog
  #{
  # Ensure = "Present"
  # Name = "QlikArchiveLog"
  # Path = "C:\ProgramData\Qlik\Sense\Repository\Archived Logs"
  # FullAccess = "Administrators"
  # Description = "Qlik Sense Scheduler access to archived logs"
  #}

  xFirewall QSS-Master
  {
    Name                  = "QSS-Master"
    DisplayName           = "Qlik Sense Scheduler Master"
    Group                 = "Qlik Sense"
    Ensure                = "Present"
    Action                = "Allow"
    Enabled               = "True"
    Profile               = ("Domain", "Private", "Public")
    Direction             = "InBound"
    LocalPort             = ("5050")
    Protocol              = "TCP"
  }
}