forked from dsccommunity/SqlServerDsc
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SqlRS: New example based on integration test (dsccommunity#933)
- Changes to SqlRS - Added complete example for SqlRS (based on the integration tests) (issue dsccommunity#634).
- Loading branch information
Showing
3 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
150 changes: 150 additions & 0 deletions
150
Examples/Resources/SqlRS/4-CompleteWithTwoInstances.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
<# | ||
.EXAMPLE | ||
This example installs to instances where the first named instance is used for | ||
the Reporting Services databases, and the second named instance is used for | ||
Reporting Services. After installing the two instances, the configuration | ||
performs a default SQL Server Reporting Services configuration. It will | ||
initialize SQL Server Reporting Services and register the default | ||
Report Server Web Service and Report Manager URLs: | ||
Report Manager: http://localhost:80/Reports_RS | ||
Report Server Web Service: http://localhost:80/ReportServer_RS | ||
#> | ||
|
||
$ConfigurationData = @{ | ||
AllNodes = @( | ||
@{ | ||
NodeName = 'localhost' | ||
|
||
# This is values used for the Reporting Services instance. | ||
InstanceName = 'RS' | ||
Features = 'RS' | ||
|
||
# This is values used for the Database Engine instance. | ||
DatabaseServerName = $env:COMPUTERNAME | ||
DatabaseServerInstanceName = 'RSDB' | ||
DatabaseServerFeatures = 'SQLENGINE' | ||
DatabaseServerCollation = 'Finnish_Swedish_CI_AS' | ||
|
||
# This is values used for both instances. | ||
MediaPath = 'Z:\Sql2016Media' | ||
InstallSharedDir = 'C:\Program Files\Microsoft SQL Server' | ||
InstallSharedWOWDir = 'C:\Program Files (x86)\Microsoft SQL Server' | ||
UpdateEnabled = 'False' | ||
BrowserSvcStartupType = 'Automatic' | ||
|
||
<# | ||
NOTE! THIS IS NOT RECOMMENDED IN PRODUCTION. | ||
This is added so that AppVeyor automatic tests can pass, otherwise | ||
the tests will fail on passwords being in plain text and not being | ||
encrypted. Because it is not possible to have a certificate in | ||
AppVeyor to encrypt the passwords we need to add the parameter | ||
'PSDscAllowPlainTextPassword'. | ||
NOTE! THIS IS NOT RECOMMENDED IN PRODUCTION. | ||
#> | ||
PSDscAllowPlainTextPassword = $true | ||
} | ||
) | ||
} | ||
|
||
Configuration Example | ||
{ | ||
[CmdletBinding()] | ||
param | ||
( | ||
[Parameter(Mandatory = $true)] | ||
[ValidateNotNullOrEmpty()] | ||
[System.Management.Automation.PSCredential] | ||
$SqlAdministratorCredential, | ||
|
||
[Parameter(Mandatory = $true)] | ||
[ValidateNotNullOrEmpty()] | ||
[System.Management.Automation.PSCredential] | ||
$SqlInstallCredential, | ||
|
||
[Parameter(Mandatory = $true)] | ||
[ValidateNotNullOrEmpty()] | ||
[System.Management.Automation.PSCredential] | ||
$SqlServiceCredential, | ||
|
||
[Parameter(Mandatory = $true)] | ||
[ValidateNotNullOrEmpty()] | ||
[System.Management.Automation.PSCredential] | ||
$SqlAgentServiceCredential, | ||
|
||
[Parameter(Mandatory = $true)] | ||
[ValidateNotNullOrEmpty()] | ||
[System.Management.Automation.PSCredential] | ||
$ReportingServicesServiceCredential | ||
) | ||
|
||
Import-DscResource -ModuleName PSDscResources | ||
Import-DscResource -ModuleName SqlServerDsc | ||
|
||
Node localhost { | ||
WindowsFeature 'NetFramework45' | ||
{ | ||
Name = 'NET-Framework-45-Core' | ||
Ensure = 'Present' | ||
} | ||
|
||
SqlSetup 'InstallDatabaseEngine' | ||
{ | ||
InstanceName = $Node.DatabaseServerInstanceName | ||
Features = $Node.DatabaseServerFeatures | ||
SourcePath = $Node.MediaPath | ||
BrowserSvcStartupType = $Node.BrowserSvcStartupType | ||
SQLCollation = $Node.DatabaseServerCollation | ||
SQLSvcAccount = $SqlServiceCredential | ||
AgtSvcAccount = $SqlAgentServiceCredential | ||
InstallSharedDir = $Node.InstallSharedDir | ||
InstallSharedWOWDir = $Node.InstallSharedWOWDir | ||
UpdateEnabled = $Node.UpdateEnabled | ||
|
||
SQLSysAdminAccounts = @( | ||
$SqlAdministratorCredential.UserName | ||
) | ||
|
||
PsDscRunAsCredential = $SqlInstallCredential | ||
|
||
DependsOn = @( | ||
'[WindowsFeature]NetFramework45' | ||
) | ||
} | ||
|
||
SqlSetup 'InstallReportingServicesInstance' | ||
{ | ||
InstanceName = $Node.InstanceName | ||
Features = $Node.Features | ||
SourcePath = $Node.MediaPath | ||
BrowserSvcStartupType = $Node.BrowserSvcStartupType | ||
RSSvcAccount = $ReportingServicesServiceCredential | ||
InstallSharedDir = $Node.InstallSharedDir | ||
InstallSharedWOWDir = $Node.InstallSharedWOWDir | ||
UpdateEnabled = $Node.UpdateEnabled | ||
|
||
PsDscRunAsCredential = $SqlInstallCredential | ||
|
||
DependsOn = @( | ||
'[WindowsFeature]NetFramework45' | ||
'[SqlSetup]InstallDatabaseEngine' | ||
) | ||
} | ||
|
||
SqlRS 'ConfigureReportingServiceInstance' | ||
{ | ||
# Instance name for the Reporting Services. | ||
InstanceName = $Node.InstanceName | ||
|
||
# Instance for Reporting Services databases. | ||
DatabaseServerName = $Node.DatabaseServerName | ||
DatabaseInstanceName = $Node.DatabaseServerInstanceName | ||
|
||
PsDscRunAsCredential = $SqlInstallCredential | ||
|
||
DependsOn = @( | ||
'[SqlSetup]InstallReportingServicesInstance' | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters