Chris, 
Traps was the answer. DCPromo by default exits with non-zero 1-4 if 
successful and 11+ on failure. Checking the return code and exiting zero 
solved the problem. throwing and exception and catching the trap produced 
consistent results and I was able to run my playbook successfully from 
start to finish a few times without error. I still get some hangups from 
time to time on the fact Gathering stage but this is few and far between, 
Thank you very much!

Nic 

On Monday, December 22, 2014 9:15:24 PM UTC-5, Chris Church wrote:
>
> 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] 
> <javascript:>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> 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/89c27597-0fc9-4a81-808f-8765ba46809d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to