Skip to content

Commit

Permalink
Win_hostname module: Change name check to WMI (ansible#56420)
Browse files Browse the repository at this point in the history
* Change name check to WMI

* Changelog fragment

* Fixed per review
  • Loading branch information
ShachafGoldstein authored and jborean93 committed May 28, 2019
1 parent 35c8739 commit 94566ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "win_hostname - Fix non netbios compliant name handling (https://github.com/ansible/ansible/issues/55283)"
3 changes: 2 additions & 1 deletion lib/ansible/modules/windows/win_hostname.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ $params = Parse-Args $args -supports_check_mode $true
$name = Get-AnsibleParam -obj $params -name "name" -type "str" -failifempty $true
$check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false

$current_computer_name = $env:ComputerName
$current_computer_name = (Get-CimInstance -Class Win32_ComputerSystem).DNSHostname

$result = @{
changed = $false
old_name = $current_computer_name
Expand Down

0 comments on commit 94566ed

Please sign in to comment.