mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Win_hostname module: Change name check to WMI (#56420)
* Change name check to WMI * Changelog fragment * Fixed per review
This commit is contained in:
parent
35c8739c2a
commit
94566ed79c
2 changed files with 4 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- "win_hostname - Fix non netbios compliant name handling (https://github.com/ansible/ansible/issues/55283)"
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue