I would definitely clean up your installation and try again - you 
definitely only need one version of the module.  I wonder perhaps if you 
have a source installation or a pip installation as well as an RPM install?

On Monday, September 19, 2016 at 7:16:03 PM UTC+1, Dimitri Yioulos wrote:
>
> Hi, Jon.
>
> Sorry for the long delay in responding.
>
> It may well be that an old version of the module is being picked up. 
>  There are two, one in core (dated July, 2016), the other one in extras 
> (dated March, 2015).  I guess this module made it into core.  If I delete 
> the version in extras, will that solve the problem.  This is an RPM install.
>
> Dimitri
>
>
> On Thursday, September 1, 2016 at 3:20:09 AM UTC-4, J Hawkesworth wrote:
>>
>> Hi,
>>
>> I wonder if you are somehow picking up an old version of the modules, as 
>> I just checked (latest devel 2.2 version and 
>>
>> If ($params.start_mode) {
>>
>> is no longer in the code.
>>
>> If you are running from source ensure you have done a git submodule 
>> update --init and a source hacking/env-setup otherwise you may pick up 
>> older versions of the modules installed elsewhere on your system.
>>
>> If it isn't something to do with picking up an old version of 
>> win_service.ps1 reply back and I'll have another think what could be 
>> causing this.
>>
>> Hope this helps,
>>
>> Jon
>>
>>
>>
>>
>> On Wednesday, August 31, 2016 at 2:12:17 PM UTC+1, Dimitri Yioulos wrote:
>>>
>>> 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/b363d07a-b8f8-4399-8b6e-4e357c5b195c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to