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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c9bf9fc8-a296-4a23-b267-0eab44eecc27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to