win_regedit error "Input string was not in a correct formatInput string was not in a correct format"

119 views
Skip to first unread message

Дубровин Юрий

unread,
Jul 25, 2016, 4:09:02 PM7/25/16
to Ansible Project
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.

J Hawkesworth

unread,
Jul 26, 2016, 1:49:52 AM7/26/16
to Ansible Project
Which ansible version are you using?
I recently fixed an error with handling change detection for dword type, so might be worth trying 2.1.1 RC5 if you can.

Jon

Дубровин Юрий

unread,
Jul 28, 2016, 2:32:43 PM7/28/16
to Ansible Project
I'm sorry. I forgot to write a version of the program. Unfortunately I have installed version 2.0.0.2. Today I will try to install the new version. 

понедельник, 25 июля 2016 г., 23:09:02 UTC+3 пользователь Дубровин Юрий написал:
Reply all
Reply to author
Forward
0 new messages