vagrant-uplift 0.2.1902.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. checksums.yaml +7 -0
  2. data/bin/console +13 -0
  3. data/bin/setup +8 -0
  4. data/lib/scripts/vagrant/uplift.vagrant.core/uplift.fix-second-network.ps1 +59 -0
  5. data/lib/scripts/vagrant/uplift.vagrant.dc12/dc.dsc.ps1 +128 -0
  6. data/lib/scripts/vagrant/uplift.vagrant.dc12/dc.replica.dsc.ps1 +117 -0
  7. data/lib/scripts/vagrant/uplift.vagrant.dc12/dc.users.dsc.ps1 +147 -0
  8. data/lib/scripts/vagrant/uplift.vagrant.dc12/tests/dc.dsc.Tests.ps1 +165 -0
  9. data/lib/scripts/vagrant/uplift.vagrant.dcjoin/dc.join.dsc.ps1 +125 -0
  10. data/lib/scripts/vagrant/uplift.vagrant.dcjoin/dc.join.hostname.ps1 +13 -0
  11. data/lib/scripts/vagrant/uplift.vagrant.dcjoin/tests/dc.join.dsc.Tests.ps1 +12 -0
  12. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/shared/sp.helpers.ps1 +155 -0
  13. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2013.dsc.ps1 +248 -0
  14. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2013.post_setup.dsc.ps1 +117 -0
  15. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.dsc.ps1 +246 -0
  16. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.farm-only.dsc.ps1 +281 -0
  17. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.info.ps1 +36 -0
  18. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.post_setup.dsc.ps1 +125 -0
  19. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.pre_setup1.dsc.ps1 +28 -0
  20. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.pre_setup2.dsc.ps1 +75 -0
  21. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/tests/sp2013.dsc.wfe.Tests.ps1 +68 -0
  22. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/tests/sp2016.dsc.wfe.Tests.ps1 +68 -0
  23. data/lib/scripts/vagrant/uplift.vagrant.sql12/sql.complete.dsc.ps1 +186 -0
  24. data/lib/scripts/vagrant/uplift.vagrant.sql12/sql.dsc.ps1 +66 -0
  25. data/lib/scripts/vagrant/uplift.vagrant.sql12/sql.optimize.dsc.ps1 +50 -0
  26. data/lib/scripts/vagrant/uplift.vagrant.sql12/sql.prepare.dsc.ps1 +60 -0
  27. data/lib/scripts/vagrant/uplift.vagrant.sql12/tests/sql.dsc.Tests.ps1 +23 -0
  28. data/lib/scripts/vagrant/uplift.vagrant.sql12/tests/sql12.dsc.Tests.ps1 +45 -0
  29. data/lib/scripts/vagrant/uplift.vagrant.sql12/tests/sql16.dsc.Tests.ps1 +22 -0
  30. data/lib/scripts/vagrant/uplift.vagrant.visual_studio13/tests/vs13.dsc.Tests.ps1 +61 -0
  31. data/lib/scripts/vagrant/uplift.vagrant.visual_studio13/vs13.dsc.post_deploy.ps1 +32 -0
  32. data/lib/scripts/vagrant/uplift.vagrant.visual_studio13/vs13.dsc.ps1 +69 -0
  33. data/lib/scripts/vagrant/uplift.vagrant.visual_studio17/tests/vs17.dsc.Tests.ps1 +61 -0
  34. data/lib/scripts/vagrant/uplift.vagrant.visual_studio17/vs17.dsc.post_deploy.ps1 +34 -0
  35. data/lib/scripts/vagrant/uplift.vagrant.visual_studio17/vs17.dsc.ps1 +134 -0
  36. data/lib/scripts/vagrant/uplift.vagrant.win12soe/soe.dsc.ps1 +115 -0
  37. data/lib/scripts/vagrant/uplift.vagrant.win12soe/soe.shortcuts.dsc.ps1 +41 -0
  38. data/lib/scripts/vagrant/uplift.vagrant.win12soe/tests/soe.dsc.modules.Tests.ps1 +71 -0
  39. data/lib/scripts/vagrant/uplift.vagrant.win12soe/tests/soe.dsc.os.Tests.ps1 +89 -0
  40. data/lib/vagrant-uplift.rb +8 -0
  41. data/lib/vagrant-uplift/config_builder.rb +819 -0
  42. data/lib/vagrant-uplift/log.rb +146 -0
  43. data/lib/vagrant-uplift/plugin-vagrant-uplift-checkpoint.rb +41 -0
  44. data/lib/vagrant-uplift/plugin.rb +16 -0
  45. data/lib/vagrant-uplift/version.rb +10 -0
  46. metadata +131 -0
@@ -0,0 +1,75 @@
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 pre-setup2 tuning..."
10
+ Write-UpliftEnv
11
+
12
+ Write-UpliftMessage "Running: Install-WindowsFeature Web-Server -IncludeAllSubFeature"
13
+ Install-WindowsFeature Web-Server -IncludeAllSubFeature
14
+
15
+ # Missed NET-WCF-HTTP-Activation45 in SharePoint 2016 images #55
16
+ # https://github.com/SubPointSolutions/uplift/issues/55
17
+ Write-UpliftMessage "Running: Install-WindowsFeature NET-WCF-HTTP-Activation45"
18
+ Install-WindowsFeature NET-WCF-HTTP-Activation45 | Out-Null
19
+
20
+ Configuration Install_SharePointFarmPreSetupTuning
21
+ {
22
+ Import-DscResource -ModuleName PSDesiredStateConfiguration
23
+ Import-DscResource -ModuleName SharePointDsc
24
+ Import-DscResource -ModuleName xWebAdministration
25
+
26
+ Node localhost {
27
+
28
+ LocalConfigurationManager
29
+ {
30
+ RebootNodeIfNeeded = $false
31
+ }
32
+
33
+ # ensuring that required services are up before running SharePoint farm creation
34
+ Service W3SVC
35
+ {
36
+ Name = "W3SVC"
37
+ StartupType = "Automatic"
38
+ State = "Running"
39
+ }
40
+
41
+ Service IISADMIN
42
+ {
43
+ DependsOn = "[Service]W3SVC"
44
+
45
+ Name = "IISADMIN"
46
+ StartupType = "Automatic"
47
+ State = "Running"
48
+ }
49
+
50
+ WindowsFeature NETWCFHTTPActivation45
51
+ {
52
+ Ensure = "Present"
53
+ Name = "NET-WCF-HTTP-Activation45"
54
+ }
55
+ }
56
+ }
57
+
58
+ $config = @{
59
+ AllNodes = @(
60
+ @{
61
+ NodeName = 'localhost'
62
+
63
+ PSDscAllowDomainUser = $true
64
+ PSDscAllowPlainTextPassword = $true
65
+ }
66
+ )
67
+ }
68
+
69
+ $configuration = Get-Command Install_SharePointFarmPreSetupTuning
70
+ Start-UpliftDSCConfiguration $configuration $config
71
+
72
+ Write-UpliftMessage "Ensuring IIS services are up"
73
+ Invoke-UpliftIISReset
74
+
75
+ exit 0
@@ -0,0 +1,68 @@
1
+ Describe 'SharePoint 2013' {
2
+
3
+ function Is-Service-Running($serviceName)
4
+ {
5
+ (get-service $serviceName).Status | Should BeLike "Running"
6
+ }
7
+
8
+ Context "General Services" {
9
+
10
+ It 'World Wide Web Publishing Service' {
11
+ Is-Service-Running "World Wide Web Publishing Service"
12
+ }
13
+
14
+ }
15
+
16
+ Context "SharePoint Services" {
17
+
18
+ It 'SharePoint Administration' {
19
+ Is-Service-Running "SharePoint Administration"
20
+ }
21
+
22
+ It 'SharePoint Search Host Controller' {
23
+ Is-Service-Running "SharePoint Search Host Controller"
24
+ }
25
+
26
+ It 'SharePoint Server Search 15' {
27
+ Is-Service-Running "SharePoint Server Search 15"
28
+ }
29
+
30
+ It 'SharePoint Timer Service' {
31
+ Is-Service-Running "SharePoint Timer Service"
32
+ }
33
+
34
+ It 'SharePoint Tracing Service' {
35
+ Is-Service-Running "SharePoint Tracing Service"
36
+ }
37
+
38
+ It 'SharePoint User Code Host' {
39
+ Is-Service-Running "SharePoint User Code Host"
40
+ }
41
+
42
+ }
43
+
44
+ function IIS-AppPool-Running($appPoolName) {
45
+ Import-Module WebAdministration
46
+ (
47
+ (get-CHildItem "IIS:\\AppPools") `
48
+ | Where-Object { $_.Name -eq $appPoolName }
49
+ ).State | Should BeLike "Started"
50
+ }
51
+
52
+ Context "SharePoint IIS App Pools" {
53
+
54
+ It 'SharePoint Web Services Root' {
55
+ IIS-AppPool-Running "SharePoint Web Services Root"
56
+ }
57
+
58
+ It 'SharePoint Central Administration v4' {
59
+ IIS-AppPool-Running "SharePoint Central Administration v4"
60
+ }
61
+
62
+ It 'SecurityTokenServiceApplicationPool' {
63
+ IIS-AppPool-Running "SecurityTokenServiceApplicationPool"
64
+ }
65
+
66
+ }
67
+
68
+ }
@@ -0,0 +1,68 @@
1
+ Describe 'SharePoint 2016' {
2
+
3
+ function Is-Service-Running($serviceName)
4
+ {
5
+ (get-service $serviceName).Status | Should BeLike "Running"
6
+ }
7
+
8
+ Context "General Services" {
9
+
10
+ It 'World Wide Web Publishing Service' {
11
+ Is-Service-Running "World Wide Web Publishing Service"
12
+ }
13
+
14
+ }
15
+
16
+ Context "SharePoint Services" {
17
+
18
+ It 'SharePoint Administration' {
19
+ Is-Service-Running "SharePoint Administration"
20
+ }
21
+
22
+ It 'SharePoint Search Host Controller' {
23
+ Is-Service-Running "SharePoint Search Host Controller"
24
+ }
25
+
26
+ It 'SharePoint Server Search 16' {
27
+ Is-Service-Running "SharePoint Server Search 16"
28
+ }
29
+
30
+ It 'SharePoint Timer Service' {
31
+ Is-Service-Running "SharePoint Timer Service"
32
+ }
33
+
34
+ It 'SharePoint Tracing Service' {
35
+ Is-Service-Running "SharePoint Tracing Service"
36
+ }
37
+
38
+ It 'SharePoint User Code Host' {
39
+ Is-Service-Running "SharePoint User Code Host"
40
+ }
41
+
42
+ }
43
+
44
+ function IIS-AppPool-Running($appPoolName) {
45
+ Import-Module WebAdministration
46
+ (
47
+ (get-CHildItem "IIS:\\AppPools") `
48
+ | Where-Object { $_.Name -eq $appPoolName }
49
+ ).State | Should BeLike "Started"
50
+ }
51
+
52
+ Context "SharePoint IIS App Pools" {
53
+
54
+ It 'SharePoint Web Services Root' {
55
+ IIS-AppPool-Running "SharePoint Web Services Root"
56
+ }
57
+
58
+ It 'SharePoint Central Administration v4' {
59
+ IIS-AppPool-Running "SharePoint Central Administration v4"
60
+ }
61
+
62
+ It 'SecurityTokenServiceApplicationPool' {
63
+ IIS-AppPool-Running "SecurityTokenServiceApplicationPool"
64
+ }
65
+
66
+ }
67
+
68
+ }
@@ -0,0 +1,186 @@
1
+ 
2
+ Import-Module Uplift.Core
3
+
4
+ try {
5
+
6
+ $exitCode = 0;
7
+
8
+ do {
9
+ Write-UpliftMessage "Executing CompleteImage action..."
10
+
11
+ # SQL SERVER – How to Get List of SQL Server Instances Installed on a Machine?
12
+ # https://blog.sqlauthority.com/2016/11/12/sql-server-get-list-sql-server-instances-installed-machine/
13
+ $service = Get-Service | Where-Object{ $_.DisplayName -like "SQL Server (*" }
14
+ $shoudComplete = ($null -eq $service)
15
+
16
+ if($shoudComplete -eq $False) {
17
+ Write-UpliftMessage "[+] server was clready completed!"
18
+ break;
19
+ } else {
20
+ Write-UpliftMessage "[~] server needs completion"
21
+ }
22
+
23
+ $sqlDir = "C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\SQLServer2016\"
24
+
25
+ $syAdmnUsers = """vagrant"""
26
+
27
+ if((Get-CimInstance -Class Win32_ComputerSystem).PartOfDomain) {
28
+ $domainName = [environment]::UserDomainName
29
+ $syAdmnUsers += " ""$domainName\vagrant"""
30
+
31
+ $dmName = (Get-CimInstance Win32_ComputerSystem).Domain.Split(".")[0]
32
+
33
+ $syAdmnUsers += " ""$dmName\vagrant"""
34
+
35
+ Write-UpliftMessage "[!] domain joined vm detected, WILL ADD $domainName\vagrant user as SQLSYSADMINACCOUNTS"
36
+ } else {
37
+ Write-UpliftMessage "[!] standalone vm detected, WILL NOT add domain vagrant user to SQLSYSADMINACCOUNTS"
38
+ }
39
+
40
+ Write-UpliftMessage "syAdmnUsers: $syAdmnUsers"
41
+
42
+ $arguments = [string]::Join(" ", @(
43
+ "/q",
44
+ "/ACTION=CompleteImage",
45
+ "/INSTANCENAME=MSSQLSERVER",
46
+ "/INSTANCEID=MSSQLSERVER",
47
+ "/SQLSVCACCOUNT=""vagrant"" ",
48
+ "/SQLSVCPASSWORD=""vagrant"" ",
49
+ "/SQLSYSADMINACCOUNTS=$syAdmnUsers ",
50
+ "/AGTSVCACCOUNT=""NT AUTHORITY\Network Service"" ",
51
+ "/IACCEPTSQLSERVERLICENSETERMS"
52
+ ))
53
+
54
+ Write-UpliftMessage "SQL DIR : $sqlDir"
55
+ Write-UpliftMessage "SQL ARGS: $arguments"
56
+
57
+ $pinfo = New-Object System.Diagnostics.ProcessStartInfo
58
+ $pinfo.FileName = "$sqlDir/setup.exe"
59
+
60
+ $pinfo.RedirectStandardError = $true
61
+ $pinfo.RedirectStandardOutput = $true
62
+
63
+ $pinfo.UseShellExecute = $false
64
+
65
+ $pinfo.Arguments = $arguments
66
+
67
+ $p = New-Object System.Diagnostics.Process
68
+
69
+ $p.StartInfo = $pinfo
70
+
71
+ Write-UpliftMessage "Started process....."
72
+ $p.Start() | Out-Null
73
+
74
+ Write-UpliftMessage "Waiting for exit..."
75
+ $p.WaitForExit()
76
+
77
+ Write-UpliftMessage "Finished running PrepareImage"
78
+
79
+ #Write-UpliftMessage $p
80
+ Write-UpliftMessage "Res ExitCode: $($p.ExitCode)"
81
+
82
+ $res = $p.ExitCode
83
+ $exitCode = $p.ExitCode
84
+
85
+ } while($res -eq $null -or $res -eq -2068774911 )
86
+
87
+ # completion
88
+ # Res ExitCode: -2147467261
89
+ # Parameter name: instanceName
90
+
91
+ # -2061893563
92
+ # The SQL Server service account login or password is not valid. Use SQL Server Configuration Manager to update the service account.
93
+ # SQLSVCACCOUNT / SQLSVCPASSWORD are wrong
94
+
95
+ # 2068774911
96
+ # There was an error generating the XML document.
97
+ # (01) 2018-12-29 14:55:25 Slp: Error: Action "Microsoft.SqlServer.Configuration.SetupExtension.FinalCalculateSettingsAction" threw an exception during execution.
98
+ # (01) 2018-12-29 14:55:25 Slp: Microsoft.SqlServer.Setup.Chainer.Workflow.ActionExecutionException: There was an error generating the XML document. ---> Microsoft.SqlServer.Chainer.Infrastructure.ChainerInfrastructureException: There was an error generating the XML document. ---> System.InvalidOperationException: There was an error generating the XML document. ---> System.Security.Cryptography.CryptographicException: Access is denied.
99
+
100
+ # mostlikely, we need to wait until TrustedInstaller process is done
101
+ # post-sysprep or start action
102
+ # then run complete action again
103
+
104
+ # 2068774911 - !!! finally, tasks shuld be run in elevated mode!!!!
105
+
106
+ # -2068643838
107
+ # conflict of re-installing
108
+ # mostlikely, we already run complete action
109
+
110
+ # -2067919934
111
+ # someting else is being installed! like, othe MIS/MSU or MSSQL installer
112
+ # also, reboot might be requred
113
+ # Microsoft.SqlServer.Setup.Chainer.Workflow.ActionExecutionException: A computer restart is required. You must restart this computer before installing SQL Server
114
+
115
+ # -2067529717
116
+ # ????
117
+
118
+
119
+ # ---
120
+
121
+
122
+ # Res ExitCode: 0 - all good
123
+
124
+ # Res ExitCode: -2067529717 - process already running
125
+
126
+ # Res ExitCode: -2022834173 - updates cannot connect to remote server
127
+ # Setup encountered a failure while running job UpdateResult.
128
+ # mostlikely, case we disabled them via registry
129
+
130
+ # Error result: -2067921930
131
+ # mostlikely, This computer does not have the Microsoft .NET Framework 3.5 Service Pack 1 installed.
132
+ # If the operating system is Windows Server 2008, download and install Microsoft .NET Framework 3.5 SP1 from http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=22
133
+ # https://social.msdn.microsoft.com/Forums/en-US/8db6ff15-b5bc-4e3a-ab33-43e26ffab925/net-35-in-a-container-aiming-to-install-sql-server
134
+
135
+ # logs under
136
+ # C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log
137
+ # https://www.buyplm.com/install-guide/pdxpert-plm-software-installation-advanced-server-sql-log-files.aspx
138
+
139
+ # C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log
140
+
141
+ # post setup
142
+ if($exitCode -eq 0) {
143
+
144
+ # start SQL server agent service
145
+ Configuration SqlDSC
146
+ {
147
+ Import-DscResource -ModuleName PSDesiredStateConfiguration
148
+
149
+ Node localhost {
150
+
151
+ Service MSSQLSERVER {
152
+ Ensure = "Present"
153
+ Name = "MSSQLSERVER"
154
+ StartupType = "Automatic"
155
+ State = "Running"
156
+ }
157
+
158
+ Service SQLSERVERAGENT {
159
+ Ensure = "Present"
160
+ Name = "SQLSERVERAGENT"
161
+ StartupType = "Automatic"
162
+ State = "Running"
163
+ }
164
+
165
+ }
166
+ }
167
+
168
+ $configuration = Get-Command SqlDSC
169
+ Start-UpliftDSCConfiguration $configuration -ExpectInDesiredState $True
170
+ }
171
+
172
+ # already installed
173
+ # if ($p.ExitCode -eq -2068643838) {
174
+ # exit 0
175
+ # }
176
+
177
+ exit $exitCode
178
+ } catch {
179
+
180
+ Write-UpliftMessage "ERROR!"
181
+ Write-UpliftMessage $_
182
+
183
+ exit 1
184
+ }
185
+
186
+ exit 1
@@ -0,0 +1,66 @@
1
+ # fail on errors and include uplift helpers
2
+ $ErrorActionPreference = "Stop"
3
+
4
+ Import-Module Uplift.Core
5
+
6
+ Write-UpliftMessage "Installing SQL Server..."
7
+ Write-UpliftEnv
8
+
9
+ $binSourcePath = Get-UpliftEnvVariable "UPLF_SQL_BIN_PATH"
10
+ $instanceName = Get-UpliftEnvVariable "UPLF_SQL_INSTANCE_NAME"
11
+ $instanceFeatures = Get-UpliftEnvVariable "UPLF_SQL_INSTANCE_FEATURES"
12
+ $sqlSysAdminAccounts = (Get-UpliftEnvVariable "UPLF_SQL_SYS_ADMIN_ACCOUNTS").Split(',')
13
+
14
+ Configuration Install_SQL
15
+ {
16
+ Import-DscResource -ModuleName 'xSQLServer'
17
+ Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
18
+
19
+ Node localhost {
20
+
21
+ LocalConfigurationManager
22
+ {
23
+ RebootNodeIfNeeded = $false
24
+ }
25
+
26
+ WindowsFeature "NET-Framework-Core"
27
+ {
28
+ Ensure = "Present"
29
+ Name = "NET-Framework-Core"
30
+ }
31
+
32
+ xSqlServerSetup "SQL"
33
+ {
34
+ DependsOn = "[WindowsFeature]NET-Framework-Core"
35
+ SourcePath = $Node.BinSourcePath
36
+ InstanceName = $Node.InstanceName
37
+ Features = $Node.InstanceFeatures
38
+ SQLSysAdminAccounts = $Node.SqlSysAdminAccounts
39
+ }
40
+ }
41
+
42
+ }
43
+
44
+ $config = @{
45
+ AllNodes = @(
46
+ @{
47
+ NodeName = 'localhost'
48
+ PSDscAllowPlainTextPassword = $true
49
+
50
+ RetryCount = 10
51
+ RetryIntervalSec = 30
52
+
53
+ BinSourcePath = $binSourcePath
54
+
55
+ InstanceName = $instanceName
56
+ InstanceFeatures = $instanceFeatures
57
+
58
+ SqlSysAdminAccounts = $sqlSysAdminAccounts
59
+ }
60
+ )
61
+ }
62
+
63
+ $configuration = Get-Command Install_SQL
64
+ Start-UpliftDSCConfiguration $configuration $config
65
+
66
+ exit 0