# Trouble with Windows modules

**URL:** <https://forum.ansible.com/t/trouble-with-windows-modules/18731>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [July 11, 2015, 12:37am UTC](https://forum.ansible.com/t/trouble-with-windows-modules/18731 "2015-07-11T00:37:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anthony\_pangan](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@anthony\_pangan](https://forum.ansible.com/u/anthony_pangan)\
**Post date:** [July 11, 2015, 12:37am UTC](https://forum.ansible.com/t/trouble-with-windows-modules/18731/1 "2015-07-11T00:37:41Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [July 11, 2015, 10:10am UTC](https://forum.ansible.com/t/trouble-with-windows-modules/18731/2 "2015-07-11T10:10:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Guillaume\_Querso](https://avatars.discourse-cdn.com/v4/letter/g/cdc98d/32.png) [@Guillaume\_Querso](https://forum.ansible.com/u/Guillaume_Querso)\
**Post date:** [July 13, 2015, 10:11am UTC](https://forum.ansible.com/t/trouble-with-windows-modules/18731/3 "2015-07-13T10:11:34Z")

</div>

have you tried to downgrade to stable version 1.9.2? i also had troubles with ansible’s modules on version 2.0

---

<div class="post-metadata">

**Author:** ![anthony\_pangan](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@anthony\_pangan](https://forum.ansible.com/u/anthony_pangan)\
**Post date:** [July 14, 2015, 6:16pm UTC](https://forum.ansible.com/t/trouble-with-windows-modules/18731/4 "2015-07-14T18:16:20Z")

</div>

I ended up downgrading to 1.9.1 via yum and all is well in the world. Thanks all.
