Skip to content

Commit

Permalink
SqlSetup: Added support for RSINSTALLMODE parameter (#1361)
Browse files Browse the repository at this point in the history
- Changes to SqlServerDsc
  - Added RSInstallMode parameter (issue #1163).
  • Loading branch information
bozho authored and johlju committed Jun 19, 2019
1 parent e8298d5 commit cc652c6
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
- Changed the logic of how default value of FailoverClusterGroupName is
set since that was preventing the resource to be able to be debugged
([issue #448](https://github.com/PowerShell/SqlServerDsc/issues/448)).
- Added RSInstallMode parameter ([issue #1163](https://github.com/PowerShell/SqlServerDsc/issues/1163)).
- Changes to SqlWindowsFirewall
- Where a version upgrade has changed paths for a database engine, the
existing firewall rule for that instance will be updated rather than
Expand Down
30 changes: 30 additions & 0 deletions DSCResources/MSFT_SqlSetup/MSFT_SqlSetup.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ $script:localizedData = Get-LocalizedData -ResourceName 'MSFT_SqlSetup'
.PARAMETER InstanceName
Name of the SQL instance to be installed.
.PARAMETER RSInstallMode
Install mode for Reporting Services. The value of this parameter cannot be determined post-install,
so the function will simply return the value of this parameter.
.PARAMETER FailoverClusterNetworkName
Host name to be assigned to the clustered SQL Server instance.
Expand Down Expand Up @@ -60,6 +64,11 @@ function Get-TargetResource
[System.String]
$InstanceName,

[Parameter()]
[ValidateSet('SharePointFilesOnlyMode', 'DefaultNativeMode', 'FilesOnlyMode')]
[System.String]
$RSInstallMode,

[Parameter()]
[System.String]
$FailoverClusterNetworkName,
Expand Down Expand Up @@ -551,6 +560,7 @@ function Get-TargetResource
FTSvcAccountUsername = $fullTextServiceAccountUsername
RSSvcAccountUsername = $reportingServiceAccountUsername
RsSvcStartupType = $RsSvcStartupType
RSInstallMode = $RSInstallMode
ASSvcAccountUsername = $analysisServiceAccountUsername
AsSvcStartupType = $AsSvcStartupType
ASCollation = $analysisCollation
Expand Down Expand Up @@ -673,6 +683,9 @@ function Get-TargetResource
.PARAMETER RSSvcAccount
Service account for Reporting Services service.
.PARAMETER RSInstallMode
Install mode for Reporting Services.
.PARAMETER ASSvcAccount
Service account for Analysis Services service.
Expand Down Expand Up @@ -894,6 +907,11 @@ function Set-TargetResource
[System.Management.Automation.PSCredential]
$RSSvcAccount,

[Parameter()]
[ValidateSet('SharePointFilesOnlyMode', 'DefaultNativeMode', 'FilesOnlyMode')]
[System.String]
$RSInstallMode,

[Parameter()]
[System.Management.Automation.PSCredential]
$ASSvcAccount,
Expand Down Expand Up @@ -1450,6 +1468,10 @@ function Set-TargetResource
{
$setupArguments += @{ RsSvcStartupType = $RsSvcStartupType}
}
if ($PSBoundParameters.ContainsKey('RSInstallMode'))
{
$setupArguments += @{ RSINSTALLMODE = $RSInstallMode}
}
}

if ($Features.Contains('AS'))
Expand Down Expand Up @@ -1785,6 +1807,9 @@ function Set-TargetResource
.PARAMETER RSSvcAccount
Service account for Reporting Services service.
.PARAMETER RSInstallMode
Install mode for Reporting Services.
.PARAMETER ASSvcAccount
Service account for Analysis Services service.
Expand Down Expand Up @@ -1997,6 +2022,11 @@ function Test-TargetResource
[System.Management.Automation.PSCredential]
$RSSvcAccount,

[Parameter()]
[ValidateSet('SharePointFilesOnlyMode', 'DefaultNativeMode', 'FilesOnlyMode')]
[System.String]
$RSInstallMode,

[Parameter()]
[System.Management.Automation.PSCredential]
$ASSvcAccount,
Expand Down
1 change: 1 addition & 0 deletions DSCResources/MSFT_SqlSetup/MSFT_SqlSetup.schema.mof
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class MSFT_SqlSetup : OMI_BaseResource
[Read, Description("Output username for the Full Text service.")] String FTSvcAccountUsername;
[Write, EmbeddedInstance("MSFT_Credential"), Description("Service account for Reporting Services service.")] String RSSvcAccount;
[Read, Description("Output username for the Reporting Services service.")] String RSSvcAccountUsername;
[Write, Description("Specifies the install mode for SQL Server Report service."), ValueMap{"SharePointFilesOnlyMode", "DefaultNativeMode", "FilesOnlyMode"}, Values{"SharePointFilesOnlyMode", "DefaultNativeMode", "FilesOnlyMode"}] String RSInstallMode;
[Write, EmbeddedInstance("MSFT_Credential"), Description("Service account for Analysis Services service.")] String ASSvcAccount;
[Read, Description("Output username for the Analysis Services service.")] String ASSvcAccountUsername;
[Write, Description("Collation for Analysis Services.")] String ASCollation;
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1893,6 +1893,8 @@ need a '*SVCPASSWORD' argument in the setup arguments.
service.
* **`[PSCredential]` RSSvcAccount** _(Write)_: Service account for Reporting Services
service.
* **`[String]` RSInstallMode** _(Write)_: Reporting Services install mode.
{ SharePointFilesOnlyMode | DefaultNativeMode | FilesOnlyMode }
* **`[PSCredential]` ASSvcAccount** _(Write)_: Service account for Analysis Services
service.
* **`[String]` ASCollation** _(Write)_: Collation for Analysis Services.
Expand Down
2 changes: 2 additions & 0 deletions Tests/Unit/MSFT_SqlSetup.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2874,6 +2874,7 @@ try
UpdateEnabled = 'True'
UpdateSource = 'C:\Updates\' # Regression test for issue #720
ASServerMode = 'TABULAR'
RSInstallMode = 'DefaultNativeMode'
SqlSvcStartupType = $mockSqlSvcStartupType
AgtSvcStartupType = $mockAgtSvcStartupType
AsSvcStartupType = $mockAsSvcStartupType
Expand Down Expand Up @@ -2907,6 +2908,7 @@ try
UpdateEnabled = 'True'
UpdateSource = 'C:\Updates' # Regression test for issue #720
ASServerMode = 'TABULAR'
RSInstallMode = 'DefaultNativeMode'
SqlSvcStartupType = $mockSqlSvcStartupType
AgtSvcStartupType = $mockAgtSvcStartupType
AsSvcStartupType = $mockAsSvcStartupType
Expand Down

0 comments on commit cc652c6

Please sign in to comment.