title: ansible-playbook hangs at setup
body: <p>I am trying to run ansible-plabook but it hangs at setup. my playbook does lot of work like calling diffferent roles and modules also it gathers facts. It used to work fine earlier, but now i am not sure what went wrong , any help is appreciated</p>
  
  <ul>
  <li>host operating system is RHEL 7</li>
  <li>ssh passwordless authentication is set between those systems</li>
  <li>my inventory file contains only 1 host system</li>
  </ul>
  
  <p>command I was running was </p>
  
  <pre><code> ansible-playbook  -i /tmp/tmpBo5Xmj -vvvvv playbook.yml -c ssh
  </code></pre>
  
  <p>here is the verbose log </p>
  
  <pre><code>TASK [setup] *******************************************************************
  &lt;172.17.239.193&gt; ESTABLISH SSH CONNECTION FOR USER: ansible
  &lt;172.17.239.193&gt; SSH: ansible.cfg set ssh_args: (-o)(UserKnownHostsFile=/dev/null)(-o)(StrictHostKeyChecking=no)
  &lt;172.17.239.193&gt; SSH: ANSIBLE_HOST_KEY_CHECKING/host_key_checking disabled: (-o)(StrictHostKeyChecking=no)
  &lt;172.17.239.193&gt; SSH: ansible_password/ansible_ssh_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)
  &lt;172.17.239.193&gt; SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)(User=ansible)
  &lt;172.17.239.193&gt; SSH: ANSIBLE_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)
  &lt;172.17.239.193&gt; SSH: PlayContext set ssh_common_args: ()
  &lt;172.17.239.193&gt; SSH: PlayContext set ssh_extra_args: ()
  &lt;172.17.239.193&gt; SSH: EXEC ssh -C -vvv -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ansible -o ConnectTimeout=10 172.17.239.193 '/bin/sh -c '"'"'( umask 77 &amp;&amp; mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1474582282.38-93511913696801 `" &amp;&amp; echo ansible-tmp-1474582282.38-93511913696801="` echo $HOME/.ansible/tmp/ansible-tmp-1474582282.38-93511913696801 `" ) &amp;&amp; sleep 0'"'"''
  &lt;172.17.239.193&gt; PUT /tmp/tmpAKnqv6 TO /home/ansible/.ansible/tmp/ansible-tmp-1474582282.38-93511913696801/setup
  &lt;172.17.239.193&gt; SSH: ansible.cfg set ssh_args: (-o)(UserKnownHostsFile=/dev/null)(-o)(StrictHostKeyChecking=no)
  &lt;172.17.239.193&gt; SSH: ANSIBLE_HOST_KEY_CHECKING/host_key_checking disabled: (-o)(StrictHostKeyChecking=no)
  &lt;172.17.239.193&gt; SSH: ansible_password/ansible_ssh_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)
  &lt;172.17.239.193&gt; SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)(User=ansible)
  &lt;172.17.239.193&gt; SSH: ANSIBLE_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)
  &lt;172.17.239.193&gt; SSH: PlayContext set ssh_common_args: ()
  &lt;172.17.239.193&gt; SSH: PlayContext set sftp_extra_args: ()
  &lt;172.17.239.193&gt; SSH: EXEC sftp -b - -C -vvv -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ansible -o ConnectTimeout=10 '[172.17.239.193]'
  &lt;172.17.239.193&gt; ESTABLISH SSH CONNECTION FOR USER: ansible
  &lt;172.17.239.193&gt; SSH: ansible.cfg set ssh_args: (-o)(UserKnownHostsFile=/dev/null)(-o)(StrictHostKeyChecking=no)
  &lt;172.17.239.193&gt; SSH: ANSIBLE_HOST_KEY_CHECKING/host_key_checking disabled: (-o)(StrictHostKeyChecking=no)
  &lt;172.17.239.193&gt; SSH: ansible_password/ansible_ssh_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)
  &lt;172.17.239.193&gt; SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)(User=ansible)
  &lt;172.17.239.193&gt; SSH: ANSIBLE_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)
  &lt;172.17.239.193&gt; SSH: PlayContext set ssh_common_args: ()
  &lt;172.17.239.193&gt; SSH: PlayContext set ssh_extra_args: ()
  &lt;172.17.239.193&gt; **SSH: EXEC ssh -C -vvv -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ansible -o ConnectTimeout=10 -tt 172.17.239.193 '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-njtihbebdvbpospbpivnpwbhrqtnfylc; LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/ansible/.ansible/tmp/ansible-tmp-1474582282.38-93511913696801/setup; rm -rf "/home/ansible/.ansible/tmp/ansible-tmp-1474582282.38-93511913696801/" &gt; /dev/null 2&gt;&amp;1'"'"'"'"'"'"'"'"' &amp;&amp; sleep 0'"'"''**
  </code></pre>
  
  <p>On the target system I could see following python process running</p>
  
  <pre><code>[root@odcrac01 ~]# ps -ef | grep python| grep ansible
  ansible  12600 12568  0 07:18 pts/0    00:00:00 /bin/sh -c sudo -H -S  -p "[sudo via ansible, key=tdtazugynuyekapktrkwjrwuawfvgkme] password: " -u root /bin/sh -c 'echo BECOME-SUCCESS-tdtazugynuyekapktrkwjrwuawfvgkme; LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/ansible/.ansible/tmp/ansible-tmp-1474582204.64-194542154309618/setup; rm -rf "/home/ansible/.ansible/tmp/ansible-tmp-1474582204.64-194542154309618/" &gt; /dev/null 2&gt;&amp;1' &amp;&amp; sleep 0
  root     12613 12600  0 07:18 pts/0    00:00:00 sudo -H -S -p [sudo via ansible, key=tdtazugynuyekapktrkwjrwuawfvgkme] password:  -u root /bin/sh -c echo BECOME-SUCCESS-tdtazugynuyekapktrkwjrwuawfvgkme; LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/ansible/.ansible/tmp/ansible-tmp-1474582204.64-194542154309618/setup; rm -rf "/home/ansible/.ansible/tmp/ansible-tmp-1474582204.64-194542154309618/" &gt; /dev/null 2&gt;&amp;1
  root     12614 12613  0 07:18 pts/0    00:00:00 /bin/sh -c echo BECOME-SUCCESS-tdtazugynuyekapktrkwjrwuawfvgkme; LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/ansible/.ansible/tmp/ansible-tmp-1474582204.64-194542154309618/setup; rm -rf "/home/ansible/.ansible/tmp/ansible-tmp-1474582204.64-194542154309618/" &gt; /dev/null 2&gt;&amp;1
  root     12615 12614  0 07:18 pts/0    00:00:00 /usr/bin/python /home/ansible/.ansible/tmp/ansible-tmp-1474582204.64-194542154309618/setup
  root     12616 12615  0 07:18 pts/0    00:00:00 /usr/bin/python /tmp/ansible_0loivr/ansible_module_setup.py
  ansible  15436 15435  0 07:20 pts/1    00:00:00 /bin/sh -c sudo -H -S -n -u root /bin/sh -c 'echo BECOME-SUCCESS-njtihbebdvbpospbpivnpwbhrqtnfylc; LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/ansible/.ansible/tmp/ansible-tmp-1474582282.38-93511913696801/setup; rm -rf "/home/ansible/.ansible/tmp/ansible-tmp-1474582282.38-93511913696801/" &gt; /dev/null 2&gt;&amp;1' &amp;&amp; sleep 0
  root     15449 15436  0 07:20 pts/1    00:00:00 sudo -H -S -n -u root /bin/sh -c echo BECOME-SUCCESS-njtihbebdvbpospbpivnpwbhrqtnfylc; LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/ansible/.ansible/tmp/ansible-tmp-1474582282.38-93511913696801/setup; rm -rf "/home/ansible/.ansible/tmp/ansible-tmp-1474582282.38-93511913696801/" &gt; /dev/null 2&gt;&amp;1
  root     15450 15449  0 07:20 pts/1    00:00:00 /bin/sh -c echo BECOME-SUCCESS-njtihbebdvbpospbpivnpwbhrqtnfylc; LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/ansible/.ansible/tmp/ansible-tmp-1474582282.38-93511913696801/setup; rm -rf "/home/ansible/.ansible/tmp/ansible-tmp-1474582282.38-93511913696801/" &gt; /dev/null 2&gt;&amp;1
  root     15451 15450  0 07:20 pts/1    00:00:00 /usr/bin/python /home/ansible/.ansible/tmp/ansible-tmp-1474582282.38-93511913696801/setup
  root     15452 15451  0 07:20 pts/1    00:00:00 /usr/bin/python /tmp/ansible_PJZfVt/ansible_module_setup.py
  </code></pre>
  
  <p>Here is the simple playbook, where i have set become: yes and become_user: root, somehow when I set become: yes it is not working, it hangs</p>
  
  <pre><code> - name: list files in target system
     hosts: clonedb
     user: ansible
     become: yes
     become_user: root
     gather_facts: yes
     tasks:
     - name: list files in target system
       command: ls
       always_run: true
       tags: list
  </code></pre>
  
  <p>if I comment the become and become_user it works fine. I have added user ansible to sudoers list in the target system, but still it hangs</p>
  
  <p>on the target system for "ansible" user i have given sudo permission by adding it to sudoers list</p>
  
  <pre><code>ansible         ALL=(ALL)       NOPASSWD: ALL
  </code></pre>
  
  <p>I try to run the sudo command as ansible user on the target system it works fine</p>
  
  <pre><code>[ansible@odcrac01 ~]$ sudo ls ~root
  anaconda-ks.cfg  cvuqdisk-1.0.9-1.rpm  install.log  install.log.syslog  remove_disk.sh
  </code></pre>
  
  <p>But on another system it works fine</p>
  
  <pre><code>(virtualapp) [ansible@OEL72-37-70 lib]$ python odcansible.py
  sys path:['/home/ansible/virtualapp/pypi_portal/lib', '/home/ansible/virtualapp/lib64/python27.zip', '/home/ansible/virtualapp/lib64/python2.7', '/home/ansible/virtualapp/lib64/python2.7/plat-linux2', '/home/ansible/virtualapp/lib64/python2.7/lib-tk', '/home/ansible/virtualapp/lib64/python2.7/lib-old', '/home/ansible/virtualapp/lib64/python2.7/lib-dynload', '/usr/lib64/python2.7', '/usr/lib/python2.7', '/home/ansible/virtualapp/lib/python2.7/site-packages']
  PLAY [create temporary directory in target system] *****************************
  
  TASK [setup] *******************************************************************
  &lt;172.17.58.95&gt; ESTABLISH SSH CONNECTION FOR USER: ansible
  &lt;172.17.58.95&gt; SSH: ansible.cfg set ssh_args: (-o)(UserKnownHostsFile=/dev/null)(-o)(StrictHostKeyChecking=no)(-o)(IdentitiesOnly=yes)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)
  &lt;172.17.58.95&gt; SSH: ANSIBLE_HOST_KEY_CHECKING/host_key_checking disabled: (-o)(StrictHostKeyChecking=no)
  &lt;172.17.58.95&gt; SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)(User=ansible)
  &lt;172.17.58.95&gt; SSH: ANSIBLE_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)
  &lt;172.17.58.95&gt; SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/home/ansible/.ansible/cp/ansible-ssh-%h-%p-%r)
  &lt;172.17.58.95&gt; SSH: EXEC sshpass -d14 ssh -C -vvv -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=ansible -o ConnectTimeout=10 -o ControlPath=/home/ansible/.ansible/cp/ansible-ssh-%h-%p-%r 172.17.58.95 '/bin/sh -c '"'"'( umask 77 &amp;&amp; mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1474661320.71-273658467725557 `" &amp;&amp; echo ansible-tmp-1474661320.71-273658467725557="` echo $HOME/.ansible/tmp/ansible-tmp-1474661320.71-273658467725557 `" ) &amp;&amp; sleep 0'"'"''
  &lt;172.17.58.95&gt; PUT /tmp/tmpITvUgQ TO /home/ansible/.ansible/tmp/ansible-tmp-1474661320.71-273658467725557/setup
  &lt;172.17.58.95&gt; SSH: disable batch mode for sshpass: (-o)(BatchMode=no)
  &lt;172.17.58.95&gt; SSH: ansible.cfg set ssh_args: (-o)(UserKnownHostsFile=/dev/null)(-o)(StrictHostKeyChecking=no)(-o)(IdentitiesOnly=yes)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)
  &lt;172.17.58.95&gt; SSH: ANSIBLE_HOST_KEY_CHECKING/host_key_checking disabled: (-o)(StrictHostKeyChecking=no)
  &lt;172.17.58.95&gt; SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)(User=ansible)
  &lt;172.17.58.95&gt; SSH: ANSIBLE_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)
  &lt;172.17.58.95&gt; SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/home/ansible/.ansible/cp/ansible-ssh-%h-%p-%r)
  &lt;172.17.58.95&gt; SSH: EXEC sshpass -d14 sftp -o BatchMode=no -b - -C -vvv -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=ansible -o ConnectTimeout=10 -o ControlPath=/home/ansible/.ansible/cp/ansible-ssh-%h-%p-%r '[172.17.58.95]'
  &lt;172.17.58.95&gt; ESTABLISH SSH CONNECTION FOR USER: ansible
  &lt;172.17.58.95&gt; SSH: ansible.cfg set ssh_args: (-o)(UserKnownHostsFile=/dev/null)(-o)(StrictHostKeyChecking=no)(-o)(IdentitiesOnly=yes)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)
  &lt;172.17.58.95&gt; SSH: ANSIBLE_HOST_KEY_CHECKING/host_key_checking disabled: (-o)(StrictHostKeyChecking=no)
  &lt;172.17.58.95&gt; SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)(User=ansible)
  &lt;172.17.58.95&gt; SSH: ANSIBLE_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)
  &lt;172.17.58.95&gt; SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/home/ansible/.ansible/cp/ansible-ssh-%h-%p-%r)
  &lt;172.17.58.95&gt; SSH: EXEC sshpass -d14 ssh -C -vvv -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=ansible -o ConnectTimeout=10 -o ControlPath=/home/ansible/.ansible/cp/ansible-ssh-%h-%p-%r -tt 172.17.58.95 '/bin/sh -c '"'"'sudo -H -S  -p "[sudo via ansible, key=wcazqfwywctzrpesmznhbpbibluqmkqg] password: " -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-wcazqfwywctzrpesmznhbpbibluqmkqg; LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/ansible/.ansible/tmp/ansible-tmp-1474661320.71-273658467725557/setup; rm -rf "/home/ansible/.ansible/tmp/ansible-tmp-1474661320.71-273658467725557/" &gt; /dev/null 2&gt;&amp;1'"'"'"'"'"'"'"'"' &amp;&amp; sleep 0'"'"''
  ok: [172.17.58.95]
  </code></pre>