diff --git a/Modules/ArcGIS/ArcGIS.psd1 b/Modules/ArcGIS/ArcGIS.psd1 index c9fbf68b..7d9c3c06 100644 --- a/Modules/ArcGIS/ArcGIS.psd1 +++ b/Modules/ArcGIS/ArcGIS.psd1 @@ -3,7 +3,7 @@ # # Generated by: Esri # -# Generated on: 10/31/2018 +# Generated on: 11/1/2018 # @{ @@ -12,7 +12,7 @@ # RootModule = '' # Version number of this module. -ModuleVersion = '1.1.2' +ModuleVersion = '1.1.3' # Supported PSEditions # CompatiblePSEditions = @() @@ -107,7 +107,7 @@ PrivateData = @{ # IconUri = '' # ReleaseNotes of this module - ReleaseNotes = 'ArcGIS Module for PowerShell DSC - 1.1.1' + ReleaseNotes = 'ArcGIS Module for PowerShell DSC - 1.1.3' # External dependent modules of this module # ExternalModuleDependencies = '' diff --git a/Modules/ArcGIS/ArcGIS.psm1 b/Modules/ArcGIS/ArcGIS.psm1 index d2ee4c16..e71db210 100644 --- a/Modules/ArcGIS/ArcGIS.psm1 +++ b/Modules/ArcGIS/ArcGIS.psm1 @@ -318,7 +318,7 @@ function Get-ArcGISURL { $ServerWAMachineNode = ($AllNodes | Where-Object { ($_.Role -icontains 'ServerWebAdaptor')} | Select-Object -First 1) $ServerWAMachineName = $ServerWAMachineNode.NodeName - $ServerHostName = Get-FQDN $ServerWAMachineName + $ServerExternalDNSName = Get-FQDN $ServerWAMachineName if(($ServerWAMachineNode.SslCertifcates | Where-Object { $_.Target -icontains 'WebAdaptor'} | Measure-Object).Count -gt 0) { $SSLCertificate = $ServerWAMachineNode.SslCertifcates | Where-Object { $_.Target -icontains 'WebAdaptor' } | Select-Object -First 1 @@ -712,21 +712,38 @@ function Configure-ArcGIS } if($JobFlag){ - Write-Host "Dot Sourcing the Configuration:- ArcGISFederation" - . "$PSScriptRoot\Configuration\ArcGISFederation.ps1" -Verbose:$false - - Write-Host "Compiling the Configuration:- ArcGISFederation" - ArcGISFederation -ConfigurationData $ConfigurationParamsHashtable + + $RemoteFederation = if($ConfigurationParamsHashtable.ConfigData.Federation){$true}else{$false} + + $PortalServerFederation = $False - if($Credential){ - $JobFlag = Start-DSCJob -ConfigurationName ArcGISFederation -Credential $Credential -DebugMode $DebugMode - }else{ - - $JobFlag = Start-DSCJob -ConfigurationName ArcGISFederation -DebugMode $DebugMode + if(-not($RemoteFederation)) + { + $ServerCheck = (($ConfigurationParamsHashtable.AllNodes | Where-Object { $_.Role -icontains 'Server' } | Measure-Object).Count -gt 0) + $PortalCheck = (($ConfigurationParamsHashtable.AllNodes | Where-Object { $_.Role -icontains 'Portal' } | Measure-Object).Count -gt 0) + if($ServerCheck -and $PortalCheck) + { + $PortalServerFederation = $True + } } - if(Test-Path ".\ArcGISFederation") { - Remove-Item ".\ArcGISFederation" -Force -ErrorAction Ignore -Recurse + if($RemoteFederation -or $PortalServerFederation){ + Write-Host "Dot Sourcing the Configuration:- ArcGISFederation" + . "$PSScriptRoot\Configuration\ArcGISFederation.ps1" -Verbose:$false + + Write-Host "Compiling the Configuration:- ArcGISFederation" + ArcGISFederation -ConfigurationData $ConfigurationParamsHashtable + + if($Credential){ + $JobFlag = Start-DSCJob -ConfigurationName ArcGISFederation -Credential $Credential -DebugMode $DebugMode + }else{ + + $JobFlag = Start-DSCJob -ConfigurationName ArcGISFederation -DebugMode $DebugMode + } + + if(Test-Path ".\ArcGISFederation") { + Remove-Item ".\ArcGISFederation" -Force -ErrorAction Ignore -Recurse + } } } diff --git a/Modules/ArcGIS/Configuration/ArcGISFederation.ps1 b/Modules/ArcGIS/Configuration/ArcGISFederation.ps1 index 69442632..ebe45217 100644 --- a/Modules/ArcGIS/Configuration/ArcGISFederation.ps1 +++ b/Modules/ArcGIS/Configuration/ArcGISFederation.ps1 @@ -47,7 +47,7 @@ Configuration ArcGISFederation } } - if($RemoteFederation -and $PortalServerFederation){ + if($RemoteFederation -or $PortalServerFederation){ if($RemoteFederation){ $PortalHostName = $ConfigurationData.ConfigData.Federation.PortalHostName $PortalPort = $ConfigurationData.ConfigData.Federation.PortalPort diff --git a/Modules/ArcGIS/DSCResources/ArcGIS_DataStore/ArcGIS_DataStore.psm1 b/Modules/ArcGIS/DSCResources/ArcGIS_DataStore/ArcGIS_DataStore.psm1 index b2da4428..26d74305 100644 --- a/Modules/ArcGIS/DSCResources/ArcGIS_DataStore/ArcGIS_DataStore.psm1 +++ b/Modules/ArcGIS/DSCResources/ArcGIS_DataStore/ArcGIS_DataStore.psm1 @@ -244,10 +244,10 @@ function Set-TargetResource Write-Verbose "A Data Store has been registered. Now checking if this machine ($env:ComputerName) with FQDN '$MachineFQDN' belongs to it" $result = Test-MachineParticipatingInBigDataStore -ServerURL $ServerURL -Token $token.token -Referer $Referer -MachineFQDN $MachineFQDN if($result) { - Write-Verbose "The machine $($env:ComputerName) with FQDN '$MachineFQDN' already participates in the data store" + Write-Verbose "The machine $($env:ComputerName) with FQDN '$MachineFQDN' already participates in a Spatio Temporal data store" $DsRegistered = $true }else { - Write-Verbose "The machine $($env:ComputerName) with FQDN '$MachineFQDN' does NOT participates in the registered data store" + Write-Verbose "The machine $($env:ComputerName) with FQDN '$MachineFQDN' does NOT participates in a registered Spatio Temporal data store" } }else { Write-Verbose "A Spatiotemporal Big Data Store has not been registered." @@ -459,7 +459,7 @@ function Test-TargetResource } if($resultSpatioTemporal) { - $resultSpatioTemporal = Test-SpatiotemporalBigDataStoreStarted -ServerURL $ServerUrl -Token $token.token -Referer $Referer -MachineFQDN $FQDN + $resultSpatioTemporal = Test-SpatiotemporalBigDataStoreStarted -ServerURL $ServerUrl -Token $token.token -Referer $Referer -MachineFQDN $MachineFQDN if($resultSpatioTemporal) { Write-Verbose 'Big data store is started' }else { @@ -470,13 +470,8 @@ function Test-TargetResource } if(($result -or $resultSpatioTemporal) -and $DataStoreTypes) { - if(-not($token)) { - $token = Get-ServerToken -ServerEndPoint $ServerUrl -ServerSiteName 'arcgis' -Credential $SiteAdministrator -Referer $Referer - } - - Write-Verbose $token.token - - $info = Get-DataStoreInfo -DataStoreAdminEndpoint "https://$($MachineFQDN):2443/arcgis/datastoreadmin" -ServerSiteAdminCredential $SiteAdministrator -ServerSiteUrl "https://$($FQDN):6443/arcgis" ` + $token = Get-ServerToken -ServerEndPoint $ServerUrl -ServerSiteName 'arcgis' -Credential $SiteAdministrator -Referer $Referer + $info = Get-DataStoreInfo -DataStoreAdminEndpoint "https://localhost:2443/arcgis/datastoreadmin" -ServerSiteAdminCredential $SiteAdministrator -ServerSiteUrl "https://$($FQDN):6443/arcgis" ` -Token $token.token -Referer $Referer foreach($dstype in $DataStoreTypes) { @@ -852,7 +847,8 @@ function Test-MachineParticipatingInBigDataStore $i = 0 while(-not($done) -and ($i -lt $response.items.length)) { $dataStorePath = $response.items[$i].path - if($dataStorePath) { + $dsType = $response.items[$i].info.dsFeature + if($dataStorePath -and ($dsType -ieq "spatioTemporal")) { Write-Verbose "NoSQL DataStore $dataStorePath found" $MachinesInDataStoreUrl = $ServerURL.TrimEnd('/') + '/arcgis/admin/data/items' + $dataStorePath + '/machines' $response = Invoke-ArcGISWebRequest -Url $MachinesInDataStoreUrl -HttpFormParameters @{ f = 'json'; token = $Token } -Referer $Referer @@ -972,7 +968,17 @@ function Test-SpatiotemporalBigDataStoreStarted $response = Invoke-ArcGISWebRequest -Url $DataItemsUrl -HttpFormParameters @{ f = 'json'; token = $Token; types = 'nosql' } -Referer $Referer $dataStorePath = $null if($response.items -and $response.items.length -gt 0) { - $dataStorePath = $response.items[0].path + $done = $false + $i = 0 + while(-not($done) -and ($i -lt $response.items.length)) { + $dsType = $response.items[$i].info.dsFeature + if($dsType -ieq "spatioTemporal") { + Write-Verbose "SpatioTemporal DataStore $dataStorePath found" + $dataStorePath = $response.items[$i].path + $done = $true + } + $i = $i + 1 + } } else { throw "Spatiotemporal Big DataStore not found in arcgis data items" } diff --git a/Modules/ArcGIS/DSCResources/ArcGIS_WebAdaptor/ArcGIS_WebAdaptor.psm1 b/Modules/ArcGIS/DSCResources/ArcGIS_WebAdaptor/ArcGIS_WebAdaptor.psm1 index c0dc1744..c094db81 100644 --- a/Modules/ArcGIS/DSCResources/ArcGIS_WebAdaptor/ArcGIS_WebAdaptor.psm1 +++ b/Modules/ArcGIS/DSCResources/ArcGIS_WebAdaptor/ArcGIS_WebAdaptor.psm1 @@ -112,7 +112,7 @@ function Set-TargetResource } $SiteURL = "https://$($ComponentHostName):6443" - $WAUrl = "http://$($HostName)/$($Context)/webadaptor" + $WAUrl = "https://$($HostName)/$($Context)/webadaptor" Write-Verbose $WAUrl $SiteUrlCheck = "$($SiteURL)/arcgis/rest/info?f=json" Wait-ForUrl $SiteUrlCheck -HttpMethod 'GET' diff --git a/Modules/ArcGIS/DSCResources/ArcGIS_WebAdaptorInstall/ArcGIS_WebAdaptorInstall.psm1 b/Modules/ArcGIS/DSCResources/ArcGIS_WebAdaptorInstall/ArcGIS_WebAdaptorInstall.psm1 index d6dee8ea..45ac7927 100644 --- a/Modules/ArcGIS/DSCResources/ArcGIS_WebAdaptorInstall/ArcGIS_WebAdaptorInstall.psm1 +++ b/Modules/ArcGIS/DSCResources/ArcGIS_WebAdaptorInstall/ArcGIS_WebAdaptorInstall.psm1 @@ -189,6 +189,7 @@ function Set-TargetResource } Write-Verbose "msiexec /x ""$ProdId"" /quiet" Start-Process 'msiexec' -ArgumentList "/x ""$ProdId"" /quiet" -wait + Remove-WebConfigurationLocation -Name "Default Web Site/$($Context)" break } }