vagrant-uplift 0.2.1902.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/console +13 -0
- data/bin/setup +8 -0
- data/lib/scripts/vagrant/uplift.vagrant.core/uplift.fix-second-network.ps1 +59 -0
- data/lib/scripts/vagrant/uplift.vagrant.dc12/dc.dsc.ps1 +128 -0
- data/lib/scripts/vagrant/uplift.vagrant.dc12/dc.replica.dsc.ps1 +117 -0
- data/lib/scripts/vagrant/uplift.vagrant.dc12/dc.users.dsc.ps1 +147 -0
- data/lib/scripts/vagrant/uplift.vagrant.dc12/tests/dc.dsc.Tests.ps1 +165 -0
- data/lib/scripts/vagrant/uplift.vagrant.dcjoin/dc.join.dsc.ps1 +125 -0
- data/lib/scripts/vagrant/uplift.vagrant.dcjoin/dc.join.hostname.ps1 +13 -0
- data/lib/scripts/vagrant/uplift.vagrant.dcjoin/tests/dc.join.dsc.Tests.ps1 +12 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/shared/sp.helpers.ps1 +155 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2013.dsc.ps1 +248 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2013.post_setup.dsc.ps1 +117 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.dsc.ps1 +246 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.farm-only.dsc.ps1 +281 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.info.ps1 +36 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.post_setup.dsc.ps1 +125 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.pre_setup1.dsc.ps1 +28 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.pre_setup2.dsc.ps1 +75 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/tests/sp2013.dsc.wfe.Tests.ps1 +68 -0
- data/lib/scripts/vagrant/uplift.vagrant.sharepoint/tests/sp2016.dsc.wfe.Tests.ps1 +68 -0
- data/lib/scripts/vagrant/uplift.vagrant.sql12/sql.complete.dsc.ps1 +186 -0
- data/lib/scripts/vagrant/uplift.vagrant.sql12/sql.dsc.ps1 +66 -0
- data/lib/scripts/vagrant/uplift.vagrant.sql12/sql.optimize.dsc.ps1 +50 -0
- data/lib/scripts/vagrant/uplift.vagrant.sql12/sql.prepare.dsc.ps1 +60 -0
- data/lib/scripts/vagrant/uplift.vagrant.sql12/tests/sql.dsc.Tests.ps1 +23 -0
- data/lib/scripts/vagrant/uplift.vagrant.sql12/tests/sql12.dsc.Tests.ps1 +45 -0
- data/lib/scripts/vagrant/uplift.vagrant.sql12/tests/sql16.dsc.Tests.ps1 +22 -0
- data/lib/scripts/vagrant/uplift.vagrant.visual_studio13/tests/vs13.dsc.Tests.ps1 +61 -0
- data/lib/scripts/vagrant/uplift.vagrant.visual_studio13/vs13.dsc.post_deploy.ps1 +32 -0
- data/lib/scripts/vagrant/uplift.vagrant.visual_studio13/vs13.dsc.ps1 +69 -0
- data/lib/scripts/vagrant/uplift.vagrant.visual_studio17/tests/vs17.dsc.Tests.ps1 +61 -0
- data/lib/scripts/vagrant/uplift.vagrant.visual_studio17/vs17.dsc.post_deploy.ps1 +34 -0
- data/lib/scripts/vagrant/uplift.vagrant.visual_studio17/vs17.dsc.ps1 +134 -0
- data/lib/scripts/vagrant/uplift.vagrant.win12soe/soe.dsc.ps1 +115 -0
- data/lib/scripts/vagrant/uplift.vagrant.win12soe/soe.shortcuts.dsc.ps1 +41 -0
- data/lib/scripts/vagrant/uplift.vagrant.win12soe/tests/soe.dsc.modules.Tests.ps1 +71 -0
- data/lib/scripts/vagrant/uplift.vagrant.win12soe/tests/soe.dsc.os.Tests.ps1 +89 -0
- data/lib/vagrant-uplift.rb +8 -0
- data/lib/vagrant-uplift/config_builder.rb +819 -0
- data/lib/vagrant-uplift/log.rb +146 -0
- data/lib/vagrant-uplift/plugin-vagrant-uplift-checkpoint.rb +41 -0
- data/lib/vagrant-uplift/plugin.rb +16 -0
- data/lib/vagrant-uplift/version.rb +10 -0
- metadata +131 -0
@@ -0,0 +1,248 @@
|
|
1
|
+
# fail on errors and include uplift helpers
|
2
|
+
$ErrorActionPreference = "Stop"
|
3
|
+
|
4
|
+
Import-Module Uplift.Core
|
5
|
+
|
6
|
+
# include shared helpers from uplift.vagrant.sharepoint handler
|
7
|
+
. "c:/windows/temp/uplift.vagrant.sharepoint/shared/sp.helpers.ps1"
|
8
|
+
|
9
|
+
Write-UpliftMessage "Creating new SharePoint farm..."
|
10
|
+
Write-UpliftEnv
|
11
|
+
|
12
|
+
$spSqlServerName = Get-UpliftEnvVariable "UPLF_SP_FARM_SQL_SERVER_HOST_NAME"
|
13
|
+
$spSqlDbPrefix = Get-UpliftEnvVariable "UPLF_SP_FARM_SQL_DB_PREFIX"
|
14
|
+
|
15
|
+
$spPassPhrase = Get-UpliftEnvVariable "UPLF_SP_FARM_PASSPHRASE"
|
16
|
+
|
17
|
+
$spSetupUserName = Get-UpliftEnvVariable "UPLF_SP_SETUP_USER_NAME"
|
18
|
+
$spSetupUserPassword = Get-UpliftEnvVariable "UPLF_SP_SETUP_USER_PASSWORD"
|
19
|
+
|
20
|
+
# prepare SQL server for SharePoint deployment
|
21
|
+
Initialize-UpSPSqlServer $spSqlServerName $spSqlDbPrefix
|
22
|
+
|
23
|
+
# deploy SharePoint
|
24
|
+
Configuration Install_SharePointFarm
|
25
|
+
{
|
26
|
+
Import-DscResource -ModuleName PSDesiredStateConfiguration
|
27
|
+
Import-DscResource -ModuleName SharePointDsc
|
28
|
+
|
29
|
+
Node localhost {
|
30
|
+
|
31
|
+
$setupUserName = $Node.SetupUserName
|
32
|
+
$setupUserPassword = $Node.SetupUserPassword
|
33
|
+
$spPassPhrase = $Node.PassPhrase
|
34
|
+
|
35
|
+
$secureSetupUserPassword = ConvertTo-SecureString $setupUserPassword -AsPlainText -Force
|
36
|
+
$setupUserCreds = New-Object System.Management.Automation.PSCredential($setupUserName, $secureSetupUserPassword)
|
37
|
+
|
38
|
+
$securePassPhrase = ConvertTo-SecureString $spPassPhrase -AsPlainText -Force
|
39
|
+
$passPhraseCreds = New-Object System.Management.Automation.PSCredential($setupUserName, $securePassPhrase)
|
40
|
+
|
41
|
+
$SPSetupAccount = $setupUserCreds
|
42
|
+
$SPFarmAccount = $setupUserCreds
|
43
|
+
|
44
|
+
$SPServicePoolManagedAccount = $setupUserCreds
|
45
|
+
$SPWebPoolManagedAccount = $setupUserCreds
|
46
|
+
|
47
|
+
$SPServiceAppPoolName = "SharePoint Service Applications"
|
48
|
+
|
49
|
+
LocalConfigurationManager
|
50
|
+
{
|
51
|
+
RebootNodeIfNeeded = $false
|
52
|
+
}
|
53
|
+
|
54
|
+
# ensuring that required services are up before running SharePoint farm creation
|
55
|
+
# that allows to fail eraly in case of spoiled images
|
56
|
+
Service W3SVC
|
57
|
+
{
|
58
|
+
Name = "W3SVC"
|
59
|
+
StartupType = "Automatic"
|
60
|
+
State = "Running"
|
61
|
+
}
|
62
|
+
|
63
|
+
Service IISADMIN
|
64
|
+
{
|
65
|
+
DependsOn = "[Service]W3SVC"
|
66
|
+
|
67
|
+
Name = "IISADMIN"
|
68
|
+
StartupType = "Automatic"
|
69
|
+
State = "Running"
|
70
|
+
}
|
71
|
+
|
72
|
+
# initial farm creation
|
73
|
+
SPFarm CreateSPFarm
|
74
|
+
{
|
75
|
+
DependsOn = "[Service]IISADMIN"
|
76
|
+
|
77
|
+
Ensure = "Present"
|
78
|
+
DatabaseServer = $spSqlServerName
|
79
|
+
FarmConfigDatabaseName = ($spSqlDbPrefix + "_Config")
|
80
|
+
Passphrase = $passPhraseCreds
|
81
|
+
FarmAccount = $SPFarmAccount
|
82
|
+
PsDscRunAsCredential = $SPSetupAccount
|
83
|
+
AdminContentDatabaseName = ($spSqlDbPrefix + "_AdminContent")
|
84
|
+
RunCentralAdmin = $true
|
85
|
+
#DependsOn = "[SPInstall]InstallSharePoint"
|
86
|
+
}
|
87
|
+
|
88
|
+
# accounts
|
89
|
+
SPManagedAccount ServicePoolManagedAccount
|
90
|
+
{
|
91
|
+
AccountName = $SPServicePoolManagedAccount.UserName
|
92
|
+
Account = $SPServicePoolManagedAccount
|
93
|
+
PsDscRunAsCredential = $SPSetupAccount
|
94
|
+
DependsOn = "[SPFarm]CreateSPFarm"
|
95
|
+
}
|
96
|
+
SPManagedAccount WebPoolManagedAccount
|
97
|
+
{
|
98
|
+
AccountName = $SPWebPoolManagedAccount.UserName
|
99
|
+
Account = $SPWebPoolManagedAccount
|
100
|
+
PsDscRunAsCredential = $SPSetupAccount
|
101
|
+
DependsOn = "[SPFarm]CreateSPFarm"
|
102
|
+
}
|
103
|
+
|
104
|
+
# default apps
|
105
|
+
SPUsageApplication UsageApplication
|
106
|
+
{
|
107
|
+
Name = "Usage Service Application"
|
108
|
+
DatabaseName = ($spSqlDbPrefix + "_SP_Usage" )
|
109
|
+
UsageLogCutTime = 5
|
110
|
+
UsageLogLocation = "C:\UsageLogs"
|
111
|
+
UsageLogMaxFileSizeKB = 1024
|
112
|
+
PsDscRunAsCredential = $SPSetupAccount
|
113
|
+
DependsOn = "[SPFarm]CreateSPFarm"
|
114
|
+
}
|
115
|
+
|
116
|
+
SPStateServiceApp StateServiceApp
|
117
|
+
{
|
118
|
+
Name = "State Service Application"
|
119
|
+
DatabaseName = ($spSqlDbPrefix + "_SP_State")
|
120
|
+
PsDscRunAsCredential = $SPSetupAccount
|
121
|
+
DependsOn = "[SPFarm]CreateSPFarm"
|
122
|
+
}
|
123
|
+
|
124
|
+
SPDistributedCacheService EnableDistributedCache
|
125
|
+
{
|
126
|
+
Name = "AppFabricCachingService"
|
127
|
+
Ensure = "Present"
|
128
|
+
CacheSizeInMB = 1024
|
129
|
+
ServiceAccount = $SPServicePoolManagedAccount.UserName
|
130
|
+
PsDscRunAsCredential = $SPSetupAccount
|
131
|
+
CreateFirewallRules = $true
|
132
|
+
DependsOn = @('[SPFarm]CreateSPFarm','[SPManagedAccount]ServicePoolManagedAccount')
|
133
|
+
}
|
134
|
+
|
135
|
+
# default services
|
136
|
+
SPServiceInstance ClaimsToWindowsTokenServiceInstance
|
137
|
+
{
|
138
|
+
Name = "Claims to Windows Token Service"
|
139
|
+
Ensure = "Present"
|
140
|
+
PsDscRunAsCredential = $SPSetupAccount
|
141
|
+
DependsOn = "[SPFarm]CreateSPFarm"
|
142
|
+
}
|
143
|
+
|
144
|
+
SPServiceInstance SecureStoreServiceInstance
|
145
|
+
{
|
146
|
+
Name = "Secure Store Service"
|
147
|
+
Ensure = "Present"
|
148
|
+
PsDscRunAsCredential = $SPSetupAccount
|
149
|
+
DependsOn = "[SPFarm]CreateSPFarm"
|
150
|
+
}
|
151
|
+
|
152
|
+
SPServiceInstance ManagedMetadataServiceInstance
|
153
|
+
{
|
154
|
+
Name = "Managed Metadata Web Service"
|
155
|
+
Ensure = "Present"
|
156
|
+
PsDscRunAsCredential = $SPSetupAccount
|
157
|
+
DependsOn = "[SPFarm]CreateSPFarm"
|
158
|
+
}
|
159
|
+
|
160
|
+
SPServiceInstance BCSServiceInstance
|
161
|
+
{
|
162
|
+
Name = "Business Data Connectivity Service"
|
163
|
+
Ensure = "Present"
|
164
|
+
PsDscRunAsCredential = $SPSetupAccount
|
165
|
+
DependsOn = "[SPFarm]CreateSPFarm"
|
166
|
+
}
|
167
|
+
|
168
|
+
SPServiceInstance SearchServiceInstance
|
169
|
+
{
|
170
|
+
Name = "SharePoint Server Search"
|
171
|
+
Ensure = "Present"
|
172
|
+
PsDscRunAsCredential = $SPSetupAccount
|
173
|
+
DependsOn = "[SPFarm]CreateSPFarm"
|
174
|
+
}
|
175
|
+
|
176
|
+
# service applications
|
177
|
+
SPServiceAppPool MainServiceAppPool
|
178
|
+
{
|
179
|
+
Name = $SPServiceAppPoolName
|
180
|
+
ServiceAccount = $SPServicePoolManagedAccount.UserName
|
181
|
+
PsDscRunAsCredential = $SPSetupAccount
|
182
|
+
DependsOn = "[SPFarm]CreateSPFarm"
|
183
|
+
}
|
184
|
+
|
185
|
+
SPSecureStoreServiceApp SecureStoreServiceApp
|
186
|
+
{
|
187
|
+
Name = "Secure Store Service Application"
|
188
|
+
ApplicationPool = $SPServiceAppPoolName
|
189
|
+
AuditingEnabled = $true
|
190
|
+
AuditlogMaxSize = 30
|
191
|
+
DatabaseName = ($spSqlDbPrefix + "_SP_SecureStore")
|
192
|
+
PsDscRunAsCredential = $SPSetupAccount
|
193
|
+
DependsOn = "[SPServiceAppPool]MainServiceAppPool"
|
194
|
+
}
|
195
|
+
|
196
|
+
SPManagedMetaDataServiceApp ManagedMetadataServiceApp
|
197
|
+
{
|
198
|
+
Name = "Managed Metadata Service Application"
|
199
|
+
PsDscRunAsCredential = $SPSetupAccount
|
200
|
+
ApplicationPool = $SPServiceAppPoolName
|
201
|
+
DatabaseName = ($spSqlDbPrefix + "_SP_MMS")
|
202
|
+
DependsOn = "[SPServiceAppPool]MainServiceAppPool"
|
203
|
+
}
|
204
|
+
|
205
|
+
SPBCSServiceApp BCSServiceApp
|
206
|
+
{
|
207
|
+
Name = "BCS Service Application"
|
208
|
+
DatabaseServer = $spSqlServerName
|
209
|
+
ApplicationPool = $SPServiceAppPoolName
|
210
|
+
DatabaseName = ($spSqlDbPrefix + "_SP_BCS")
|
211
|
+
PsDscRunAsCredential = $SPSetupAccount
|
212
|
+
DependsOn = @('[SPServiceAppPool]MainServiceAppPool', '[SPSecureStoreServiceApp]SecureStoreServiceApp')
|
213
|
+
}
|
214
|
+
|
215
|
+
SPSearchServiceApp SearchServiceApp
|
216
|
+
{
|
217
|
+
Name = "Search Service Application"
|
218
|
+
DatabaseName = ($spSqlDbPrefix + "_SP_Search")
|
219
|
+
ApplicationPool = $SPServiceAppPoolName
|
220
|
+
PsDscRunAsCredential = $SPSetupAccount
|
221
|
+
DependsOn = "[SPServiceAppPool]MainServiceAppPool"
|
222
|
+
}
|
223
|
+
}
|
224
|
+
}
|
225
|
+
|
226
|
+
$config = @{
|
227
|
+
AllNodes = @(
|
228
|
+
@{
|
229
|
+
NodeName = 'localhost'
|
230
|
+
|
231
|
+
PSDscAllowDomainUser = $true
|
232
|
+
PSDscAllowPlainTextPassword = $true
|
233
|
+
|
234
|
+
RetryCount = 10
|
235
|
+
RetryIntervalSec = 30
|
236
|
+
|
237
|
+
SetupUserName = $spSetupUserName
|
238
|
+
SetupUserPassword = $spSetupUserPassword
|
239
|
+
|
240
|
+
PassPhrase = $spPassPhrase
|
241
|
+
}
|
242
|
+
)
|
243
|
+
}
|
244
|
+
|
245
|
+
$configuration = Get-Command Install_SharePointFarm
|
246
|
+
Start-UpliftDSCConfiguration $configuration $config
|
247
|
+
|
248
|
+
exit 0
|
@@ -0,0 +1,117 @@
|
|
1
|
+
# fail on errors and include uplift helpers
|
2
|
+
$ErrorActionPreference = "Stop"
|
3
|
+
|
4
|
+
Import-Module Uplift.Core
|
5
|
+
|
6
|
+
# include shared helpers from uplift.vagrant.sharepoint handler
|
7
|
+
. "c:/windows/temp/uplift.vagrant.sharepoint/shared/sp.helpers.ps1"
|
8
|
+
|
9
|
+
Write-UpliftMessage "Running SharePoint post-setup tuning..."
|
10
|
+
Write-UpliftEnv
|
11
|
+
|
12
|
+
Configuration Install_SharePointFarmTuning
|
13
|
+
{
|
14
|
+
Import-DscResource -ModuleName PSDesiredStateConfiguration
|
15
|
+
Import-DscResource -ModuleName SharePointDsc
|
16
|
+
Import-DscResource -ModuleName xWebAdministration
|
17
|
+
|
18
|
+
Node localhost {
|
19
|
+
|
20
|
+
LocalConfigurationManager
|
21
|
+
{
|
22
|
+
RebootNodeIfNeeded = $false
|
23
|
+
}
|
24
|
+
|
25
|
+
Service SharePointAdministration {
|
26
|
+
Ensure = "Present"
|
27
|
+
Name = "SPAdminV4"
|
28
|
+
StartupType = "Automatic"
|
29
|
+
State = "Running"
|
30
|
+
}
|
31
|
+
|
32
|
+
Service SharePointSearchHostController {
|
33
|
+
Ensure = "Present"
|
34
|
+
Name = "SPSearchHostController"
|
35
|
+
StartupType = "Automatic"
|
36
|
+
State = "Running"
|
37
|
+
}
|
38
|
+
|
39
|
+
Service SharePointServerSearch15 {
|
40
|
+
Ensure = "Present"
|
41
|
+
Name = "OSearch15"
|
42
|
+
StartupType = "Automatic"
|
43
|
+
State = "Running"
|
44
|
+
}
|
45
|
+
|
46
|
+
Service SharePointTimerService {
|
47
|
+
Ensure = "Present"
|
48
|
+
Name = "SPTimerV4"
|
49
|
+
StartupType = "Automatic"
|
50
|
+
State = "Running"
|
51
|
+
}
|
52
|
+
|
53
|
+
Service SharePointTracingService {
|
54
|
+
Ensure = "Present"
|
55
|
+
Name = "SPTraceV4"
|
56
|
+
StartupType = "Automatic"
|
57
|
+
State = "Running"
|
58
|
+
}
|
59
|
+
|
60
|
+
Service SharePointUserCodeHost {
|
61
|
+
Ensure = "Present"
|
62
|
+
Name = "SPUserCodeV4"
|
63
|
+
StartupType = "Automatic"
|
64
|
+
State = "Running"
|
65
|
+
}
|
66
|
+
|
67
|
+
xWebsite SharePointCentralAdministrationv4 {
|
68
|
+
Ensure = "Present"
|
69
|
+
Name="SharePoint Central Administration v4"
|
70
|
+
State = "Started"
|
71
|
+
}
|
72
|
+
|
73
|
+
xWebsite SharePointWebServices {
|
74
|
+
Ensure = "Present"
|
75
|
+
Name="SharePoint Web Services"
|
76
|
+
State = "Started"
|
77
|
+
}
|
78
|
+
|
79
|
+
xWebAppPool SecurityTokenServiceApplicationPool {
|
80
|
+
Ensure = "Present"
|
81
|
+
Name="SecurityTokenServiceApplicationPool"
|
82
|
+
State = "Started"
|
83
|
+
}
|
84
|
+
|
85
|
+
xWebAppPool SharePointCentralAdministrationv4AppPool {
|
86
|
+
Ensure = "Present"
|
87
|
+
Name="SharePoint Central Administration v4"
|
88
|
+
State = "Started"
|
89
|
+
}
|
90
|
+
|
91
|
+
xWebAppPool SharePointWebServicesRootAppPool {
|
92
|
+
Ensure = "Present"
|
93
|
+
Name="SharePoint Web Services Root"
|
94
|
+
State = "Started"
|
95
|
+
}
|
96
|
+
|
97
|
+
}
|
98
|
+
}
|
99
|
+
|
100
|
+
$config = @{
|
101
|
+
AllNodes = @(
|
102
|
+
@{
|
103
|
+
NodeName = 'localhost'
|
104
|
+
|
105
|
+
PSDscAllowDomainUser = $true
|
106
|
+
PSDscAllowPlainTextPassword = $true
|
107
|
+
|
108
|
+
RetryCount = 10
|
109
|
+
RetryIntervalSec = 30
|
110
|
+
}
|
111
|
+
)
|
112
|
+
}
|
113
|
+
|
114
|
+
$configuration = Get-Command Install_SharePointFarmTuning
|
115
|
+
Start-UpliftDSCConfiguration $configuration $config
|
116
|
+
|
117
|
+
exit 0
|
@@ -0,0 +1,246 @@
|
|
1
|
+
# fail on errors and include uplift helpers
|
2
|
+
$ErrorActionPreference = "Stop"
|
3
|
+
|
4
|
+
Import-Module Uplift.Core
|
5
|
+
|
6
|
+
# include shared helpers from uplift.vagrant.sharepoint handler
|
7
|
+
. "c:/windows/temp/uplift.vagrant.sharepoint/shared/sp.helpers.ps1"
|
8
|
+
|
9
|
+
Write-UpliftMessage "Creating new SharePoint farm..."
|
10
|
+
Write-UpliftEnv
|
11
|
+
|
12
|
+
$spSqlServerName = Get-UpliftEnvVariable "UPLF_SP_FARM_SQL_SERVER_HOST_NAME"
|
13
|
+
$spSqlDbPrefix = Get-UpliftEnvVariable "UPLF_SP_FARM_SQL_DB_PREFIX"
|
14
|
+
|
15
|
+
$spPassPhrase = Get-UpliftEnvVariable "UPLF_SP_FARM_PASSPHRASE"
|
16
|
+
|
17
|
+
$spSetupUserName = Get-UpliftEnvVariable "UPLF_SP_SETUP_USER_NAME"
|
18
|
+
$spSetupUserPassword = Get-UpliftEnvVariable "UPLF_SP_SETUP_USER_PASSWORD"
|
19
|
+
|
20
|
+
# prepare SQL server for SharePoint deployment
|
21
|
+
Initialize-UpSPSqlServer $spSqlServerName $spSqlDbPrefix
|
22
|
+
|
23
|
+
# deploy SharePoint
|
24
|
+
Configuration Install_SharePointFarm
|
25
|
+
{
|
26
|
+
Import-DscResource -ModuleName PSDesiredStateConfiguration
|
27
|
+
Import-DscResource -ModuleName SharePointDsc
|
28
|
+
|
29
|
+
Node localhost {
|
30
|
+
|
31
|
+
$setupUserName = $Node.SetupUserName
|
32
|
+
$setupUserPassword = $Node.SetupUserPassword
|
33
|
+
$spPassPhrase = $Node.PassPhrase
|
34
|
+
|
35
|
+
$secureSetupUserPassword = ConvertTo-SecureString $setupUserPassword -AsPlainText -Force
|
36
|
+
$setupUserCreds = New-Object System.Management.Automation.PSCredential($setupUserName, $secureSetupUserPassword)
|
37
|
+
|
38
|
+
$securePassPhrase = ConvertTo-SecureString $spPassPhrase -AsPlainText -Force
|
39
|
+
$passPhraseCreds = New-Object System.Management.Automation.PSCredential($setupUserName, $securePassPhrase)
|
40
|
+
|
41
|
+
$SPSetupAccount = $setupUserCreds
|
42
|
+
$SPFarmAccount = $setupUserCreds
|
43
|
+
|
44
|
+
$SPServicePoolManagedAccount = $setupUserCreds
|
45
|
+
$SPWebPoolManagedAccount = $setupUserCreds
|
46
|
+
|
47
|
+
$SPServiceAppPoolName = "SharePoint Service Applications"
|
48
|
+
|
49
|
+
LocalConfigurationManager
|
50
|
+
{
|
51
|
+
RebootNodeIfNeeded = $false
|
52
|
+
}
|
53
|
+
|
54
|
+
# ensuring that required services are up before running SharePoint farm creation
|
55
|
+
# that allows to fail eraly in case of spoiled images
|
56
|
+
Service W3SVC
|
57
|
+
{
|
58
|
+
Name = "W3SVC"
|
59
|
+
StartupType = "Automatic"
|
60
|
+
State = "Running"
|
61
|
+
}
|
62
|
+
|
63
|
+
Service IISADMIN
|
64
|
+
{
|
65
|
+
DependsOn = "[Service]W3SVC"
|
66
|
+
|
67
|
+
Name = "IISADMIN"
|
68
|
+
StartupType = "Automatic"
|
69
|
+
State = "Running"
|
70
|
+
}
|
71
|
+
|
72
|
+
# initial farm creation
|
73
|
+
SPFarm CreateSPFarm
|
74
|
+
{
|
75
|
+
DependsOn = "[Service]IISADMIN"
|
76
|
+
|
77
|
+
Ensure = "Present"
|
78
|
+
ServerRole = "SingleServerFarm"
|
79
|
+
DatabaseServer = $spSqlServerName
|
80
|
+
FarmConfigDatabaseName = ($spSqlDbPrefix + "_Config")
|
81
|
+
Passphrase = $passPhraseCreds
|
82
|
+
FarmAccount = $SPFarmAccount
|
83
|
+
PsDscRunAsCredential = $SPSetupAccount
|
84
|
+
AdminContentDatabaseName = ($spSqlDbPrefix + "_AdminContent")
|
85
|
+
RunCentralAdmin = $true
|
86
|
+
#DependsOn = "[SPInstall]InstallSharePoint"
|
87
|
+
}
|
88
|
+
|
89
|
+
# accounts
|
90
|
+
SPManagedAccount ServicePoolManagedAccount
|
91
|
+
{
|
92
|
+
AccountName = $SPServicePoolManagedAccount.UserName
|
93
|
+
Account = $SPServicePoolManagedAccount
|
94
|
+
PsDscRunAsCredential = $SPSetupAccount
|
95
|
+
DependsOn = "[SPFarm]CreateSPFarm"
|
96
|
+
}
|
97
|
+
SPManagedAccount WebPoolManagedAccount
|
98
|
+
{
|
99
|
+
AccountName = $SPWebPoolManagedAccount.UserName
|
100
|
+
Account = $SPWebPoolManagedAccount
|
101
|
+
PsDscRunAsCredential = $SPSetupAccount
|
102
|
+
DependsOn = "[SPFarm]CreateSPFarm"
|
103
|
+
}
|
104
|
+
|
105
|
+
# default apps
|
106
|
+
SPUsageApplication UsageApplication
|
107
|
+
{
|
108
|
+
Name = "Usage Service Application"
|
109
|
+
DatabaseName = ($spSqlDbPrefix + "_SP_Usage" )
|
110
|
+
UsageLogCutTime = 5
|
111
|
+
UsageLogLocation = "C:\UsageLogs"
|
112
|
+
UsageLogMaxFileSizeKB = 1024
|
113
|
+
PsDscRunAsCredential = $SPSetupAccount
|
114
|
+
DependsOn = "[SPFarm]CreateSPFarm"
|
115
|
+
}
|
116
|
+
|
117
|
+
SPStateServiceApp StateServiceApp
|
118
|
+
{
|
119
|
+
Name = "State Service Application"
|
120
|
+
DatabaseName = ($spSqlDbPrefix + "_SP_State")
|
121
|
+
PsDscRunAsCredential = $SPSetupAccount
|
122
|
+
DependsOn = "[SPFarm]CreateSPFarm"
|
123
|
+
}
|
124
|
+
|
125
|
+
SPDistributedCacheService EnableDistributedCache
|
126
|
+
{
|
127
|
+
Name = "AppFabricCachingService"
|
128
|
+
Ensure = "Present"
|
129
|
+
CacheSizeInMB = 1024
|
130
|
+
ServiceAccount = $SPServicePoolManagedAccount.UserName
|
131
|
+
PsDscRunAsCredential = $SPSetupAccount
|
132
|
+
CreateFirewallRules = $true
|
133
|
+
DependsOn = @('[SPFarm]CreateSPFarm','[SPManagedAccount]ServicePoolManagedAccount')
|
134
|
+
}
|
135
|
+
|
136
|
+
# default services
|
137
|
+
SPServiceInstance ClaimsToWindowsTokenServiceInstance
|
138
|
+
{
|
139
|
+
Name = "Claims to Windows Token Service"
|
140
|
+
Ensure = "Present"
|
141
|
+
PsDscRunAsCredential = $SPSetupAccount
|
142
|
+
DependsOn = "[SPFarm]CreateSPFarm"
|
143
|
+
}
|
144
|
+
|
145
|
+
SPServiceInstance SecureStoreServiceInstance
|
146
|
+
{
|
147
|
+
Name = "Secure Store Service"
|
148
|
+
Ensure = "Present"
|
149
|
+
PsDscRunAsCredential = $SPSetupAccount
|
150
|
+
DependsOn = "[SPFarm]CreateSPFarm"
|
151
|
+
}
|
152
|
+
|
153
|
+
SPServiceInstance ManagedMetadataServiceInstance
|
154
|
+
{
|
155
|
+
Name = "Managed Metadata Web Service"
|
156
|
+
Ensure = "Present"
|
157
|
+
PsDscRunAsCredential = $SPSetupAccount
|
158
|
+
DependsOn = "[SPFarm]CreateSPFarm"
|
159
|
+
}
|
160
|
+
|
161
|
+
SPServiceInstance BCSServiceInstance
|
162
|
+
{
|
163
|
+
Name = "Business Data Connectivity Service"
|
164
|
+
Ensure = "Present"
|
165
|
+
PsDscRunAsCredential = $SPSetupAccount
|
166
|
+
DependsOn = "[SPFarm]CreateSPFarm"
|
167
|
+
}
|
168
|
+
|
169
|
+
SPServiceInstance SearchServiceInstance
|
170
|
+
{
|
171
|
+
Name = "SharePoint Server Search"
|
172
|
+
Ensure = "Present"
|
173
|
+
PsDscRunAsCredential = $SPSetupAccount
|
174
|
+
DependsOn = "[SPFarm]CreateSPFarm"
|
175
|
+
}
|
176
|
+
|
177
|
+
# service applications
|
178
|
+
SPServiceAppPool MainServiceAppPool
|
179
|
+
{
|
180
|
+
Name = $SPServiceAppPoolName
|
181
|
+
ServiceAccount = $SPServicePoolManagedAccount.UserName
|
182
|
+
PsDscRunAsCredential = $SPSetupAccount
|
183
|
+
DependsOn = "[SPFarm]CreateSPFarm"
|
184
|
+
}
|
185
|
+
|
186
|
+
SPSecureStoreServiceApp SecureStoreServiceApp
|
187
|
+
{
|
188
|
+
Name = "Secure Store Service Application"
|
189
|
+
ApplicationPool = $SPServiceAppPoolName
|
190
|
+
AuditingEnabled = $true
|
191
|
+
AuditlogMaxSize = 30
|
192
|
+
DatabaseName = ($spSqlDbPrefix + "_SP_SecureStore")
|
193
|
+
PsDscRunAsCredential = $SPSetupAccount
|
194
|
+
DependsOn = "[SPServiceAppPool]MainServiceAppPool"
|
195
|
+
}
|
196
|
+
|
197
|
+
SPManagedMetaDataServiceApp ManagedMetadataServiceApp
|
198
|
+
{
|
199
|
+
Name = "Managed Metadata Service Application"
|
200
|
+
PsDscRunAsCredential = $SPSetupAccount
|
201
|
+
ApplicationPool = $SPServiceAppPoolName
|
202
|
+
DatabaseName = ($spSqlDbPrefix + "_SP_MMS")
|
203
|
+
DependsOn = "[SPServiceAppPool]MainServiceAppPool"
|
204
|
+
}
|
205
|
+
|
206
|
+
SPBCSServiceApp BCSServiceApp
|
207
|
+
{
|
208
|
+
Name = "BCS Service Application"
|
209
|
+
DatabaseServer = $spSqlServerName
|
210
|
+
ApplicationPool = $SPServiceAppPoolName
|
211
|
+
DatabaseName = ($spSqlDbPrefix + "_SP_BCS")
|
212
|
+
PsDscRunAsCredential = $SPSetupAccount
|
213
|
+
DependsOn = @('[SPServiceAppPool]MainServiceAppPool', '[SPSecureStoreServiceApp]SecureStoreServiceApp')
|
214
|
+
}
|
215
|
+
|
216
|
+
SPSearchServiceApp SearchServiceApp
|
217
|
+
{
|
218
|
+
Name = "Search Service Application"
|
219
|
+
DatabaseName = ($spSqlDbPrefix + "_SP_Search")
|
220
|
+
ApplicationPool = $SPServiceAppPoolName
|
221
|
+
PsDscRunAsCredential = $SPSetupAccount
|
222
|
+
DependsOn = "[SPServiceAppPool]MainServiceAppPool"
|
223
|
+
}
|
224
|
+
}
|
225
|
+
}
|
226
|
+
|
227
|
+
$config = @{
|
228
|
+
AllNodes = @(
|
229
|
+
@{
|
230
|
+
NodeName = 'localhost'
|
231
|
+
|
232
|
+
PSDscAllowDomainUser = $true
|
233
|
+
PSDscAllowPlainTextPassword = $true
|
234
|
+
|
235
|
+
SetupUserName = $spSetupUserName
|
236
|
+
SetupUserPassword = $spSetupUserPassword
|
237
|
+
|
238
|
+
PassPhrase = $spPassPhrase
|
239
|
+
}
|
240
|
+
)
|
241
|
+
}
|
242
|
+
|
243
|
+
$configuration = Get-Command Install_SharePointFarm
|
244
|
+
Start-UpliftDSCConfiguration $configuration $config
|
245
|
+
|
246
|
+
exit 0
|