OctopusDeploy / OctopusDSC

| Public | A PowerShell DSC resource for installing Octopus Deploy & Tentacles
Other
1 stars 60 forks source link

Ensure that we use correct types in return from Get-TargetResource #261

Closed matt-richardson closed 4 years ago

matt-richardson commented 4 years ago

We thought we'd fix the issue when the masterkey was triggering a restart, but we missed a bit (even though I wrote lots of tests 🤦‍♂️).

Added some more tests to confirm its the right type as well.

Customer reported:

Unfortunately, there is still a need to make a tiny adjustment. The function Get-ServerConfiguration on the OctopusDSCHelpers.ps1 file adds the 'OctopusMasterKey' property as a plain password text into the $config object. Nevertheless, this property is expected to be a PSCredential.

Therefore, line 270 ...

$config | Add-Member -NotePropertyName "OctopusMasterKey" -NotePropertyValue $masterkey

... should be replaced by something like ...

$masterkeycred = New-Object System.Management.Automation.PSCredential ("notused", ($masterkey | ConvertTo-SecureString -AsPlainText -Force))
$config | Add-Member -NotePropertyName "OctopusMasterKey" -NotePropertyValue $masterkeycred

Fixes https://github.com/OctopusDeploy/OctopusDSC/issues/258