Hello.
I have a problem with win_regedit.
My code:
`
- name: Windows Update.
hosts: windows
tasks: - name: RebootRelaunchTimeout.
win_regedit:
key: HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU
value: RebootRelaunchTimeout
data: 000005a0
datatype: dword
`
When error:
TASK [RebootRelaunchTimeout.] ************************************************** task path: /etc/ansible/playbooks/WUset.yml:71 <ansible2008r2> ESTABLISH WINRM CONNECTION FOR USER: admin on PORT 5986 TO ansible2008r2 <ansible2012r2> ESTABLISH WINRM CONNECTION FOR USER: admin on PORT 5986 TO ansible2012r2 <ansible2008r2> EXEC Set-StrictMode -Version Latest (New-Item -Type Directory -Path $env:temp -Name "ansible-tmp-1469437877.68-199496534619062").FullName | Write-Host -Separator ''; <ansible2012r2> EXEC Set-StrictMode -Version Latest (New-Item -Type Directory -Path $env:temp -Name "ansible-tmp-1469437877.69-195428104380917").FullName | Write-Host -Separator ''; <ansible2008r2> PUT "/tmp/tmpjENPim" TO "C:\Users\admin\AppData\Local\Temp\ansible-tmp-1469437877.68-199496534619062\win_regedit.ps1" <ansible2012r2> PUT "/tmp/tmpo9luil" TO "C:\Users\admin\AppData\Local\Temp\ansible-tmp-1469437877.69-195428104380917\win_regedit.ps1" <ansible2008r2> EXEC Set-StrictMode -Version Latest Try { & "C:\Users\admin\AppData\Local\Temp\ansible-tmp-1469437877.68-199496534619062\win_regedit.ps1" } Catch { $_obj = @{ failed = $true } If ($_.Exception.GetType) { $_obj.Add('msg', $_.Exception.Message) } Else { $_obj.Add('msg', $_.ToString()) } If ($_.InvocationInfo.PositionMessage) { $_obj.Add('exception', $_.InvocationInfo.PositionMessage) } ElseIf ($_.ScriptStackTrace) { $_obj.Add('exception', $_.ScriptStackTrace) } Try { $_obj.Add('error_record', ($_ | ConvertTo-Json | ConvertFrom-Json)) } Catch { } Echo $_obj | ConvertTo-Json -Compress -Depth 99 Exit 1 } Finally { Remove-Item "C:\Users\admin\AppData\Local\Temp\ansible-tmp-1469437877.68-199496534619062" -Force -Recurse -ErrorAction SilentlyContinue } <ansible2012r2> EXEC Set-StrictMode -Version Latest Try { & "C:\Users\admin\AppData\Local\Temp\ansible-tmp-1469437877.69-195428104380917\win_regedit.ps1" } Catch { $_obj = @{ failed = $true } If ($_.Exception.GetType) { $_obj.Add('msg', $_.Exception.Message) } Else { $_obj.Add('msg', $_.ToString()) } If ($_.InvocationInfo.PositionMessage) { $_obj.Add('exception', $_.InvocationInfo.PositionMessage) } ElseIf ($_.ScriptStackTrace) { $_obj.Add('exception', $_.ScriptStackTrace) } Try { $_obj.Add('error_record', ($_ | ConvertTo-Json | ConvertFrom-Json)) } Catch { } Echo $_obj | ConvertTo-Json -Compress -Depth 99 Exit 1 } Finally { Remove-Item "C:\Users\admin\AppData\Local\Temp\ansible-tmp-1469437877.69-195428104380917" -Force -Recurse -ErrorAction SilentlyContinue } fatal: [ansible2008r2]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_name": "win_regedit"}, "msg": "Cannot convert value \"000005a0\" to type \"System.UInt32\". Error: \"Input string was not in a correct format.\""} fatal: [ansible2012r2]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_name": "win_regedit"}, "msg": "Cannot convert value \"000005a0\" to type \"System.UInt32\". Error: \"Input string was not in a correct format.\""}
Can you help me? Thank you.