Skip to content

Commit

Permalink
win_dns_client - fix bug in devel and added tests (ansible#58971)
Browse files Browse the repository at this point in the history
* win_dns_client - fix bug in devel and added tests

* Fix sanity issue
  • Loading branch information
jborean93 committed Jul 11, 2019
1 parent 6aad3a6 commit bcc23e7
Show file tree
Hide file tree
Showing 5 changed files with 752 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/ansible/modules/windows/win_dns_client.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,12 @@ Function Set-DnsClientServerAddressLegacy {
$adapter_config = Get-CIMInstance Win32_NetworkAdapterConfiguration -Filter "Index=$idx"

If($ResetServerAddresses) {
$res = $adapter_config.SetDNSServerSearchOrder()
$arguments = @{}
}
Else {
$res = $adapter_config.SetDNSServerSearchOrder($ServerAddresses)
$arguments = @{ DNSServerSearchOrder = $ServerAddresses }
}
$res = Invoke-CimMethod -InputObject $adapter_config -MethodName SetDNSServerSearchOrder -Arguments $arguments

If($res.ReturnValue -ne 0) {
throw "Set-DnsClientServerAddressLegacy: Error calling SetDNSServerSearchOrder, code $($res.ReturnValue))"
Expand Down
1 change: 1 addition & 0 deletions test/integration/targets/win_dns_client/aliases
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shippable/windows/group2
Loading

0 comments on commit bcc23e7

Please sign in to comment.