All,

I'm running version 2.1.1, and have a very simple play to restart a service 
on my Win2k8 and Win2k12 servers:

---

- hosts: all
  gather_facts: false

  tasks:
    - name: restart ListManagerWeb
      win_service:
        name: ListManagerWeb
        state: restarted
        start_mode: auto

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."}*


Why, all of a sudden, am I seeing this behavior, and how do I fix it?

With thanks.


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/16f8944f-a0d0-4c3f-8cb1-113f5bddb6fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to