It's a matter of narrowing down there the hang happens, the best way to do 
this is to narrow down is to find a single task that is repeatable and will 
always result in the hang. When you do this you can then debug further to 
narrow down where exactly the hang occurs, this can be done by;

   - Running the command manually to see if it works properly
   - Checking the logs that relate to the action, this could be Windows 
   Event logs for Windows stuff but it could also just be log files for the 
   program you are calling
   - Use something like win_command/win_shell to run the same step manually 
   and see if the problem exists in the module or in the calling program + 
   possibly WinRM

If you can't reliably replicate the hang then you need to do some more work 
in trying to find common scenarios that cause it to happen. Common 
scenarios you can try and identify are;

   - Whether this happens when calling a certain program, e.g. chocolatey
      - Using Chocolatey as an example, if it only happens when using it 
      look at the Chocolatey logs on the system, IIRC this is at 
      C:\ProgramData\Chocolatey
      - Going further, I would then try win_command/win_shell to run the 
      same task and see if it hangs
      - I would also run the same command locally (outside of WinRM) and 
      see if it hangs/prompts something
      - Whether this happens only on a certain host, or group of hosts
      - If a group of hosts then do they share anything in common, e.g. PS 
      version, Windows version and so on
   - If it just happens random for any task, e.g. for win_file, win_stat, 
   any other module then that is good info to know
      - This would indicate a potential problem with Ansible's exec model 
      but not necessarily
   - Try out older Ansible versions, e.g. 2.6, 2.7, or 2.8 to see if the 
   problem is also there
   - If it only started appearing after a set date then look at what 
   changed then
      - This could be things like a Windows update
      - A program update
      - Python package change
      - Ansible update
      - GPO policy change
      - So much more
      
Identifying hangs aren't easy but without knowing the full story is next to 
impossible. From what you are saying the problem looks like it is happening 
on the execution side and unrelated to the Ansible controller so debugging 
the Python process probably won't give you any good information.

Thanks

Jordan

-- 
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/acb70280-af28-4cfe-9f77-7e33d5136292%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to