Trouble with Windows modules

418 views
Skip to first unread message

anthony pangan

unread,
Jul 10, 2015, 8:39:27 PM7/10/15
to ansible...@googlegroups.com
Hi all,

I'm a complete no0b with Ansible, so sorry if I'm overlooking anything obvious. It seems that arguments I'm sending to Windows modules are not being acknowledged. With win_chocolatey, I'm getting a "missing required arguments: name" error. Similarly this occurs with win_msi, but with the path argument. Running win_ping returns successfully, so I am able to execute remote commands on the client via Ansible.

$ ansible windows -vvvv -i production -m win_chocolatey -a name=atom
Using  as config file
<win_client> ESTABLISH WINRM CONNECTION FOR USER: win_user on PORT 5986 TO win_client
<win_client> EXEC (New-Item -Type Directory -Path $env:temp -Name "ansible-tmp-1436569974.94-109882179190252").FullName | Write-Host -Separator '';
<win_client> PUT /tmp/tmp0a8PHo TO C:\Users\win_user\AppData\Local\Temp\ansible-tmp-1436569974.94-109882179190252\\win_chocolatey
<win_client> EXEC PowerShell -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -File "C:\Users\win_user\AppData\Local\Temp\ansible-tmp-1436569974.94-109882179190252\\win_chocolatey.ps1"; Remove-Item "C:\Users\win_user\AppData\Local\Temp\ansible-tmp-1436569974.94-109882179190252\" -Force -Recurse;
win_client | FAILED! => {u'msg': u'missing required argument: name', u'failed': True, u'changed': False, u'invocation': {u'module_name': u'win_chocolatey', u'module_args': {u'name': u'atom'}}}

$ ansible windows -vvv -i production -m win_msi -a path=C:\\Temp\\some_msi.msi
Using  as config file
<win_client> ESTABLISH WINRM CONNECTION FOR USER: win_user on PORT 5986 TO win_client
<win_client> EXEC (New-Item -Type Directory -Path $env:temp -Name "ansible-tmp-1436570331.32-112559327157120").FullName | Write-Host -Separator '';
<win_client> PUT /tmp/tmpypj083 TO C:\Users\win_user\AppData\Local\Temp\ansible-tmp-1436570331.32-112559327157120\\win_msi
<win_client> EXEC PowerShell -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -File "C:\Users\win_user\AppData\Local\Temp\ansible-tmp-1436570331.32-112559327157120\\win_msi.ps1"; Remove-Item "C:\Users\win_user\AppData\Local\Temp\ansible-tmp-1436570331.32-112559327157120\" -Force -Recurse;
win_client | FAILED! => {u'msg': u'missing required arguments: path', u'failed': True, u'changed': False, u'invocation': {u'module_name': u'win_msi', u'module_args': {u'path': u'C:\\Temp\\some_msi.msi'}}}

ansible windows -vvv -i production -m win_ping
Using  as config file
<win_client> ESTABLISH WINRM CONNECTION FOR USER: win_user on PORT 5986 TO win_client
<win_client> EXEC (New-Item -Type Directory -Path $env:temp -Name "ansible-tmp-1436570360.66-113839788381177").FullName | Write-Host -Separator '';
<win_client> PUT /tmp/tmp73P19o TO C:\Users\win_user\AppData\Local\Temp\ansible-tmp-1436570360.66-113839788381177\\win_ping
<win_client> EXEC PowerShell -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -File "C:\Users\win_user\AppData\Local\Temp\ansible-tmp-1436570360.66-113839788381177\\win_ping.ps1"; Remove-Item "C:\Users\win_user\AppData\Local\Temp\ansible-tmp-1436570360.66-113839788381177\" -Force -Recurse;
win_client | SUCCESS => {
    "invocation": {
        "module_name": "win_ping",
        "module_args": {}
    },
    "changed": false,
    "ping": "pong"
}

ansible --version
ansible 2.0.0 (devel a9712bb0fb) last updated 2015/07/09 15:18:10 (GMT -700)
  lib/ansible/modules/core: (detached HEAD 8257053756) last updated 2015/07/09 15:18:15 (GMT -700)
  lib/ansible/modules/extras: (detached HEAD 639902ff20) last updated 2015/07/09 15:18:20 (GMT -700)
  v1/ansible/modules/core: (detached HEAD f8d8af17cd) last updated 2015/07/09 15:18:24 (GMT -700)
  v1/ansible/modules/extras: (detached HEAD 495ad450e5) last updated 2015/07/09 15:18:29 (GMT -700)
  configured module search path = None

Controller: CentOS 6.6
Windows Host: Windows 7 SP1

Thanks in advanced!

J Hawkesworth

unread,
Jul 11, 2015, 6:10:27 AM7/11/15
to ansible...@googlegroups.com
Hi,

Not sure what is going on here, but please can you try putting all the module arguments inside single quotes.

So your command line would end -a 'name=atom state=present'

Hope that helps.

Jon

Guillaume Querso

unread,
Jul 13, 2015, 6:11:35 AM7/13/15
to ansible...@googlegroups.com
have you tried to downgrade to stable version 1.9.2? i also had troubles with ansible's modules on version 2.0

anthony pangan

unread,
Jul 14, 2015, 2:16:49 PM7/14/15
to ansible...@googlegroups.com
I ended up downgrading to 1.9.1 via yum and all is well in the world. Thanks all.

--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/28ca6902-30f3-45ff-951d-94f1e43ab3a0%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages