I'm running version 2.1.1, and have a very simple play to restart a service on my Win2k8 and Win2k12 servers:
The start_mode parameter is optional and, until a few days ago, the play would run without it. However, if I run the play without it, I get the following:
<talk> ESTABLISH WINRM CONNECTION FOR USER: ansible on PORT 5986 TO talk
<talk> EXEC Set-StrictMode -Version Latest
(New-Item -Type Directory -Path $env:temp -Name "ansible-tmp-1472648842.63-190726517193215").FullName | Write-Host -Separator '';
<talk> PUT "/tmp/tmp7PEdUH" TO "C:\Users\ansible\AppData\Local\Temp\ansible-tmp-1472648842.63-190726517193215\win_service.ps1"
<talk> EXEC Set-StrictMode -Version Latest
Try
{
& 'C:\Users\ansible\AppData\Local\Temp\ansible-tmp-1472648842.63-190726517193215\win_service.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
}
An exception occurred during task execution. The full traceback is:
At C:\Users\ansible\AppData\Local\Temp\ansible-tmp-1472648842.63-190726517193215\win_service.ps1:265 char:5
+ If ($params.start_mode) {
+ ~~~~~~~~~~~~~~~~~~
fatal: [talk]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_name": "win_service"}, "msg": "The property 'start_mode' cannot be found on this object. Verify that the property exists."}
With thanks.