vagrant-uplift 0.2.1902.19 → 0.2.1902.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/lib/scripts/vagrant/uplift.vagrant.dc12/dc.dsc.ps1 +2 -2
  3. data/lib/scripts/vagrant/uplift.vagrant.dc12/dc.replica.dsc.ps1 +2 -2
  4. data/lib/scripts/vagrant/uplift.vagrant.dc12/dc.users.dsc.ps1 +2 -2
  5. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/_sp2013_image_packages.dsc.ps1 +40 -0
  6. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2013.dsc.ps1 +2 -2
  7. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2013.post_setup.dsc.ps1 +3 -3
  8. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.dsc.ps1 +1 -1
  9. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.farm-minimal-services.dsc.ps1 +279 -0
  10. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.farm-only.dsc.ps1 +34 -128
  11. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.post_setup.dsc.ps1 +2 -2
  12. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.pre_setup2.dsc.ps1 +2 -2
  13. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.sp-accounts.dsc.ps1 +98 -0
  14. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.sp-image-setup.dsc.ps1 +56 -0
  15. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.sql-accounts.dsc.ps1 +106 -0
  16. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/sp2016.web-application.dsc.ps1 +117 -0
  17. data/lib/scripts/vagrant/uplift.vagrant.sharepoint/tests/sp2016.minimal-services.Tests.ps1 +47 -0
  18. data/lib/scripts/vagrant/uplift.vagrant.sql12/sql.dsc.ps1 +1 -1
  19. data/lib/scripts/vagrant/uplift.vagrant.sql12/sql.optimize.dsc.ps1 +3 -2
  20. data/lib/scripts/vagrant/uplift.vagrant.sql12/sql.prepare.dsc.ps1 +1 -1
  21. data/lib/scripts/vagrant/uplift.vagrant.win12soe/soe.shortcuts.dsc.ps1 +58 -4
  22. data/lib/vagrant-uplift/appinsights.rb +173 -0
  23. data/lib/vagrant-uplift/config_builder.rb +1231 -819
  24. data/lib/vagrant-uplift/log.rb +15 -4
  25. data/lib/vagrant-uplift/version.rb +1 -1
  26. metadata +13 -5
@@ -12,8 +12,8 @@ Write-UpliftEnv
12
12
  Configuration Install_SharePointFarmTuning
13
13
  {
14
14
  Import-DscResource -ModuleName PSDesiredStateConfiguration
15
- Import-DscResource -ModuleName SharePointDsc
16
- Import-DscResource -ModuleName xWebAdministration
15
+ Import-DscResource -ModuleName SharePointDsc -ModuleVersion "1.9.0.0"
16
+ Import-DscResource -ModuleName xWebAdministration -ModuleVersion "1.19.0.0"
17
17
 
18
18
  Node localhost {
19
19
 
@@ -20,8 +20,8 @@ Install-WindowsFeature NET-WCF-HTTP-Activation45 | Out-Null
20
20
  Configuration Install_SharePointFarmPreSetupTuning
21
21
  {
22
22
  Import-DscResource -ModuleName PSDesiredStateConfiguration
23
- Import-DscResource -ModuleName SharePointDsc
24
- Import-DscResource -ModuleName xWebAdministration
23
+ Import-DscResource -ModuleName SharePointDsc -ModuleVersion "1.9.0.0"
24
+ Import-DscResource -ModuleName xWebAdministration -ModuleVersion "1.19.0.0"
25
25
 
26
26
  Node localhost {
27
27
 
@@ -0,0 +1,98 @@
1
+ # fail on errors and include uplift helpers
2
+ $ErrorActionPreference = "Stop"
3
+
4
+ Import-Module Uplift.Core
5
+
6
+ Write-UpliftMessage "Configring SharePoint accounts..."
7
+ Write-UpliftEnv
8
+
9
+ Configuration Configure_SharePointUsers {
10
+
11
+ Import-DscResource -ModuleName PSDesiredStateConfiguration
12
+
13
+ Import-DscResource -ModuleName xActiveDirectory -ModuleVersion 2.17.0.0
14
+
15
+ Node localhost
16
+ {
17
+ $dependsOnString = @()
18
+
19
+ $domainAdminCreds = New-Object System.Management.Automation.PSCredential(
20
+ "uplift\vagrant",
21
+ (ConvertTo-SecureString "vagrant" -AsPlainText -Force)
22
+ )
23
+
24
+ foreach($user in $Node.Users) {
25
+
26
+ $userCreds = New-Object System.Management.Automation.PSCredential(
27
+ $user,
28
+ (ConvertTo-SecureString "uplift!QAZ" -AsPlainText -Force)
29
+ )
30
+
31
+ $dependsOnString += ("[xADUser]User_$user")
32
+
33
+ xADUser "User_$user"
34
+ {
35
+ DomainName = "uplift"
36
+ DomainAdministratorCredential = $domainAdminCreds
37
+ UserName = $user
38
+ Password = $userCreds
39
+ Ensure = "Present"
40
+ }
41
+ }
42
+
43
+ xADGroup DomainAdmins
44
+ {
45
+ GroupName = "Domain Admins"
46
+ MembersToInclude = $Node.DomainAdminUsers
47
+ DependsOn = $dependsOnString
48
+
49
+ Credential = $domainAdminCreds
50
+ }
51
+ }
52
+
53
+ }
54
+
55
+ # SharePoint 2016 Service Accounts
56
+ # https://absolute-sharepoint.com/2017/03/sharepoint-2016-service-accounts-recommendations.html
57
+ $config = @{
58
+ AllNodes = @(
59
+ @{
60
+ NodeName = 'localhost'
61
+ PSDscAllowPlainTextPassword = $true
62
+ PSDscAllowDomainUser = $true
63
+
64
+ RetryCount = 10
65
+ RetryIntervalSec = 30
66
+
67
+ Users = @(
68
+ "sp_install"
69
+
70
+ "sp_admin"
71
+ "sp_farm"
72
+ "sp_services"
73
+ "sp_pool"
74
+
75
+ "sp_crawl"
76
+ "sp_sync"
77
+ "sp_c2wts"
78
+
79
+ "sp_su"
80
+ "sp_sr",
81
+
82
+ "uplift_user1",
83
+ "uplift_user2",
84
+ "uplift_user3"
85
+ )
86
+
87
+ DomainAdminUsers = @(
88
+ "sp_install"
89
+ "sp_admin"
90
+ )
91
+ }
92
+ )
93
+ }
94
+
95
+ $configuration = Get-Command Configure_SharePointUsers
96
+ Start-UpliftDSCConfiguration $configuration $config
97
+
98
+ exit 0
@@ -0,0 +1,56 @@
1
+ # fail on errors and include uplift helpers
2
+ $ErrorActionPreference = "Stop"
3
+
4
+ Import-Module Uplift.Core
5
+
6
+ Write-UpliftMessage "[~] Installing SharePoint specific image settings"
7
+ Write-UpliftEnv
8
+
9
+ Configuration SharePoint_ImageConfiguration
10
+ {
11
+ Import-DscResource -ModuleName PSDesiredStateConfiguration
12
+ Import-DscResource -ModuleName xCredSSP -ModuleVersion 1.3.0.0
13
+
14
+ Node "localhost"
15
+ {
16
+ LocalConfigurationManager
17
+ {
18
+ ConfigurationMode = 'ApplyOnly'
19
+ RebootNodeIfNeeded = $false
20
+ RefreshMode = "Push"
21
+ }
22
+
23
+ xCredSSP CredSSPServer
24
+ {
25
+ Ensure = "Present"
26
+ Role = "Server"
27
+ }
28
+
29
+
30
+ xCredSSP CredSSPClient
31
+ {
32
+ Ensure = "Present"
33
+ Role = "Client"
34
+ DelegateComputers = "*"
35
+ }
36
+ }
37
+ }
38
+
39
+ $config = @{
40
+ AllNodes = @(
41
+ @{
42
+ NodeName = 'localhost'
43
+
44
+ PSDscAllowDomainUser = $true
45
+ PSDscAllowPlainTextPassword = $true
46
+
47
+ RetryCount = 10
48
+ RetryIntervalSec = 30
49
+ }
50
+ )
51
+ }
52
+
53
+ $configuration = Get-Command SharePoint_ImageConfiguration
54
+ Start-UpliftDSCConfiguration $configuration $config $False
55
+
56
+ exit 0
@@ -0,0 +1,106 @@
1
+ # fail on errors and include uplift helpers
2
+ $ErrorActionPreference = "Stop"
3
+
4
+ Import-Module Uplift.Core
5
+
6
+ Write-UpliftMessage "Configring SharePoint accounts..."
7
+ Write-UpliftEnv
8
+
9
+ Configuration Configure_SharePointSQLUsers {
10
+
11
+ Import-DscResource -ModuleName PSDesiredStateConfiguration
12
+
13
+ Import-DscResource -ModuleName SqlServerDsc -ModuleVersion 12.2.0.0
14
+
15
+ Node localhost
16
+ {
17
+ $computerName = $env:COMPUTERNAME
18
+ $instanceName = 'MSSQLSERVER'
19
+
20
+ $adminsGroup = "BUILTIN\Administrators";
21
+
22
+ $domainAdminCreds = New-Object System.Management.Automation.PSCredential(
23
+ "uplift\vagrant",
24
+ (ConvertTo-SecureString "vagrant" -AsPlainText -Force)
25
+ )
26
+
27
+ SqlServerLogin Add_AdministratorsGroup
28
+ {
29
+ Ensure = 'Present'
30
+
31
+ Name = $adminsGroup
32
+ LoginType = 'WindowsGroup'
33
+
34
+ ServerName = $computerName
35
+ InstanceName = $instanceName
36
+
37
+ PsDscRunAsCredential = $domainAdminCreds
38
+ }
39
+
40
+ SqlServerRole Grant_AdministratorsGroup_Db_Creator
41
+ {
42
+ Ensure = 'Present'
43
+ ServerRoleName = 'db_creator'
44
+ MembersToInclude = $adminsGroup
45
+
46
+ ServerName = $computerName
47
+ InstanceName = $instanceName
48
+
49
+ PsDscRunAsCredential = $domainAdminCreds
50
+
51
+ DependsOn = @(
52
+ '[SqlServerLogin]Add_AdministratorsGroup'
53
+ )
54
+ }
55
+
56
+ SqlServerRole Grant_AdministratorsGroup_SecurityAdmin
57
+ {
58
+ Ensure = 'Present'
59
+ ServerRoleName = 'securityadmin'
60
+ MembersToInclude = $adminsGroup
61
+
62
+ ServerName = $computerName
63
+ InstanceName = $instanceName
64
+
65
+ PsDscRunAsCredential = $domainAdminCreds
66
+
67
+ DependsOn = @(
68
+ '[SqlServerLogin]Add_AdministratorsGroup'
69
+ )
70
+ }
71
+
72
+ SqlServerRole Grant_AdministratorsGroup_SysAdmin
73
+ {
74
+ Ensure = 'Present'
75
+ ServerRoleName = 'sysadmin'
76
+ MembersToInclude = $adminsGroup
77
+
78
+ ServerName = $computerName
79
+ InstanceName = $instanceName
80
+
81
+ PsDscRunAsCredential = $domainAdminCreds
82
+
83
+ DependsOn = @(
84
+ '[SqlServerLogin]Add_AdministratorsGroup'
85
+ )
86
+ }
87
+ }
88
+ }
89
+
90
+ $config = @{
91
+ AllNodes = @(
92
+ @{
93
+ NodeName = 'localhost'
94
+ PSDscAllowPlainTextPassword = $true
95
+ PSDscAllowDomainUser = $true
96
+
97
+ RetryCount = 10
98
+ RetryIntervalSec = 30
99
+ }
100
+ )
101
+ }
102
+
103
+ $configuration = Get-Command Configure_SharePointSQLUsers
104
+ Start-UpliftDSCConfiguration $configuration $config
105
+
106
+ 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 "Creating new SharePoint Web Application..."
10
+ Write-UpliftEnv
11
+
12
+ $spSetupUserName = Get-UpliftEnvVariable "UPLF_SP_SETUP_USER_NAME"
13
+ $spSetupUserPassword = Get-UpliftEnvVariable "UPLF_SP_SETUP_USER_PASSWORD"
14
+
15
+ $webAppPort = Get-UpliftEnvVariable "UPLF_SP_WEB_APP_PORT"
16
+
17
+ # deploy SharePoint Web App
18
+ Configuration Install_SharePointWebApp
19
+ {
20
+ Import-DscResource -ModuleName PSDesiredStateConfiguration
21
+ Import-DscResource -ModuleName SharePointDsc -ModuleVersion "1.9.0.0"
22
+
23
+ Node localhost {
24
+
25
+ $ensureWebApp = 'Present'
26
+
27
+ $setupUserName = $Node.SetupUserName
28
+ $setupUserPassword = $Node.SetupUserPassword
29
+
30
+ $secureSetupUserPassword = ConvertTo-SecureString $setupUserPassword -AsPlainText -Force
31
+ $setupUserCreds = New-Object System.Management.Automation.PSCredential($setupUserName, $secureSetupUserPassword)
32
+
33
+ $SPSetupAccount = $setupUserCreds
34
+ $SPFarmAccount = $setupUserCreds
35
+
36
+ $SPServicePoolManagedAccount = $setupUserCreds
37
+ $SPWebPoolManagedAccount = $setupUserCreds
38
+
39
+ # web app settings
40
+ $deleteWebApp = $Node.WebAppDelete
41
+ if($deleteWebApp -eq $true) { $ensureWebApp = 'Absent' }
42
+
43
+ $webAppUrl = "http://" + $Node.MachineName
44
+
45
+ $webAppPort = $Node.WebAppPort
46
+ if($null -eq $webAppPort) { $webAppPort = 80; }
47
+
48
+ # minimal config to create web app
49
+ SPManagedAccount WebAppPoolManagedAccount
50
+ {
51
+ Ensure = 'Present'
52
+
53
+ AccountName = $setupUserCreds.UserName
54
+ Account = $setupUserCreds
55
+ PsDscRunAsCredential = $setupUserCreds
56
+ }
57
+
58
+ # web app config
59
+ SPWebApplication WebApp
60
+ {
61
+ Ensure = $ensureWebApp
62
+
63
+ Name = "Intranet - $webAppPort"
64
+ ApplicationPool = "Intranet Web App"
65
+ ApplicationPoolAccount = $setupUserCreds.UserName
66
+ AllowAnonymous = $false
67
+
68
+ # https://github.com/PowerShell/SharePointDsc/issues/707
69
+ AuthenticationMethod = "NTLM"
70
+ DatabaseName = "Intraner_Content_$webAppPort"
71
+ Url = $webAppUrl
72
+ Port = $webAppPort
73
+ PsDscRunAsCredential = $setupUserCreds
74
+
75
+ DependsOn = "[SPManagedAccount]WebAppPoolManagedAccount"
76
+ }
77
+
78
+ # root site collection config
79
+ if($ensure -eq 'Present') {
80
+ # create root site collection if Present is set for the web app
81
+ SPSite RootSite
82
+ {
83
+ Url = $webAppUrl + ":" + $webAppPort
84
+ OwnerAlias = ($setupUserCreds.UserName)
85
+ Name = "Intranet Root Site"
86
+ Template = "STS#0"
87
+ PsDscRunAsCredential = $setupUserCreds
88
+ DependsOn = "[SPWebApplication]WebApp"
89
+ }
90
+ }
91
+ }
92
+ }
93
+
94
+ $config = @{
95
+ AllNodes = @(
96
+ @{
97
+ NodeName = 'localhost'
98
+ PSDscAllowPlainTextPassword = $true
99
+
100
+ RetryCount = 10
101
+ RetryIntervalSec = 30
102
+
103
+ WebAppPort = $webAppPort
104
+ WebAppDelete = ($env:UPLF_SP_WEB_APP_DELETE -ne $null)
105
+
106
+ MachineName = ($env:COMPUTERNAME)
107
+
108
+ SetupUserName = $spSetupUserName
109
+ SetupUserPassword = $spSetupUserPassword
110
+ }
111
+ )
112
+ }
113
+
114
+ $configuration = Get-Command Install_SharePointWebApp
115
+ Start-UpliftDSCConfiguration $configuration $config
116
+
117
+ exit 0
@@ -0,0 +1,47 @@
1
+ cls
2
+
3
+ Add-PSSnapin "Microsoft.SharePoint.PowerShell"
4
+ $apps = Get-SPServiceApplication
5
+
6
+ Describe 'SharePoint Minimal Services Config' {
7
+
8
+ function Check-ServiceApp($name) {
9
+ $app = Get-SPServiceApplication -Name $name
10
+
11
+ It 'exists' {
12
+ $app | Should Not Be $null
13
+ }
14
+
15
+ It 'online' {
16
+ $app.Status | Should Not Be $null
17
+ }
18
+ }
19
+
20
+ Context "Usage Application" {
21
+ Check-ServiceApp("Usage Service Application")
22
+ }
23
+
24
+ Context "State Service App" {
25
+ Check-ServiceApp("State Service Application")
26
+ }
27
+
28
+ Context "Managed Metadata Service App" {
29
+ Check-ServiceApp("Managed Metadata Service Application")
30
+ }
31
+
32
+ Context "Secure Store Service App" {
33
+ Check-ServiceApp("Secure Store Service Application")
34
+ }
35
+
36
+ Context "Search Service App" {
37
+ Check-ServiceApp("Search Service Application")
38
+ }
39
+
40
+ Context "User Profile Service App" {
41
+ Check-ServiceApp("User Profile Service Application")
42
+ }
43
+
44
+ Context "Security Token Service Application" {
45
+ Check-ServiceApp("SecurityTokenServiceApplication")
46
+ }
47
+ }