Verify that you're running a recent version of pywinrm (either http://github.com/diyan/pywinrm/archive/master.zip#egg=pywinrm or the latest from PyPI will work). Earlier versions didn't correctly handle a script taking longer than 60 seconds.
PowerShell scripts that encounter an error won't exit with a nonzero return code by default (which is what normally indicates an error to Ansible). A script will need to use a try/catch block or trap block (e.g. https://github.com/ansible/ansible/blob/devel/test/integration/roles/test_win_script/files/test_script_with_errors.ps1) to exit appropriately in case of an error. Otherwise, error messages will be printed to stderr and ignored. If you need to start another program and make sure the script waits for it to finish, you may need to use Start-Process/Wait-Process instead of simply running the command. On Mon, Dec 22, 2014 at 6:27 PM, J Hawkesworth < [email protected]> wrote: > The only time I have seen inconsistent behaviour similar to what you > describe I was trying to control machines which were many network hops away > from the controller. > One thing to try would be to keep an eye on the windows event log on the > remote machines. > > I guess it might be worth checking what kind of network speeds you are > getting just in case you are working over a busy network. > > Hope that's some help. > > 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 [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/29015c82-bf90-411e-b05a-83f8ab58733a%40googlegroups.com > . > 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 [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/CAH%2BKTJ4dYoNKbSgs_Cxn8WZM3RTRSAKf3apsqY%3D%3D0GyP9y3qLA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
