Discussion:
[ansible-project] Trouble with Windows modules
anthony pangan
2015-07-11 00:37:41 UTC
Permalink
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'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'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!
--
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+***@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/bdf07e5d-6859-4b11-a85c-da50806ceb35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
J Hawkesworth
2015-07-11 10:10:26 UTC
Permalink
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
--
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+***@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/7e610773-07b1-4f89-bc99-7161e61d3198%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Guillaume Querso
2015-07-13 10:11:34 UTC
Permalink
have you tried to downgrade to stable version 1.9.2? i also had troubles
with ansible's modules on version 2.0
Post by anthony pangan
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'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'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!
--
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+***@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.
anthony pangan
2015-07-14 18:16:20 UTC
Permalink
I ended up downgrading to 1.9.1 via yum and all is well in the world.
Thanks all.
Post by Guillaume Querso
have you tried to downgrade to stable version 1.9.2? i also had troubles
with ansible's modules on version 2.0
Post by anthony pangan
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'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'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!
--
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
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/28ca6902-30f3-45ff-951d-94f1e43ab3a0%40googlegroups.com
<https://groups.google.com/d/msgid/ansible-project/28ca6902-30f3-45ff-951d-94f1e43ab3a0%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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+***@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/CAMtc%2BYQ-tA-xP6c0s0jSU6ed--0OJVZN89qCyUCO4YOL0eNdPw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...