title: How to detect why Ansible playbook hangs during execution
body: <p>Some of tasks I wrote start and never end. Ansible does not provide any errors or logs that would explain this, even with -vvvv option. Playbook just hangs and passing hours doesn't change anything.</p>
  
  <p>When I try to run my tasks manually (by entering commands via SSH) everything is fine. </p>
  
  <p>Example task that hangs:</p>
  
  <pre><code>- name: apt upgrade
    shell: apt-get upgrade
  </code></pre>
  
  <p>Is there any way to see stdout and stderr ? I tried:</p>
  
  <pre><code>- name: apt upgrade
    shell: apt-get upgrade
    register: hello
  - debug: msg="{{ hello.stdout }}"
  - debug: msg="{{ hello.stderr }}"
  </code></pre>
  
  <p>but nothing changed.</p>
  
  <p>I do have required permissions and I pass correct sudo password - other tasks that require sudo execute correctly.</p>