title: ansible playbook [setup] gather facts - SSH UNREACHABLE Connection timed out during banner
body: <p>I'm on a Mac machine.</p>
  
  <pre><code>$ which ansible
  /Library/Frameworks/Python.framework/Versions/3.5/bin/ansible
  </code></pre>
  
  <p>or I guess, <code>ansible</code> can be located at a generic location: <code>/usr/bin/ansible</code> (for ex: on CentOS/Ubuntu). </p>
  
  <pre><code>$ ansible --version
  ansible 2.2.0.0
  </code></pre>
  
  <p>Running the following playbook works fine from my other vagrant / Ubuntu box.</p>
  
  <p>Playbook file looks like:</p>
  
  <pre><code>- hosts: all
    become: true
    gather_facts: true
  
    roles:
      - a_role_which_just_say_hello_world_debug_msg
  </code></pre>
  
  <p>From my local machine, I can successfully <code>ssh</code> to the target servers/the following server (without any password as I have already added the .pem key file using <code>ssh-add</code>), which is failing in Ansible playbook's <code>[Setup]</code>  (gather facts step) in Ansible playbook run.</p>
  
  <p>On Mac machine, I'm getting this error sometimes (not everytime). Error: <code>Failed to connect to the host via ssh: Connection timed out during banner exchange</code>. PS: this issue is not coming all the time.</p>
  
  <pre><code>$ ansible-playbook -i inventory -l tag_cluster_mycluster myplabook.yml
  
  PLAY [all] *********************************************************************
  
  TASK [setup] *******************************************************************
  ok: [myclusterSomeServer01_i_07f318688f6339971]
  fatal: [myclusterSomeServer02_i_03df6f1f988e665d9]: UNREACHABLE! =&gt; {"changed": false, "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", "unreachable": true}
  </code></pre>
  
  <p>OK, tried couple of times, same behavior, out of 15 servers (that I have in the mycluster cluster), the <code>[SETUP]</code> setup is failing during the gathering facts setup and next time it's working fine.</p>
  
  <p><strong>Retried:</strong>
      <em>$ ansible-playbook -i inventory -l tag_cluster_mycluster myplabook.yml</em></p>
  
  <pre><code>PLAY [all] *********************************************************************
  
  TASK [setup] *******************************************************************
  ok: [myclusterSomeServer01_i_07f318688f6339971]
  ok: [myclusterSomeServer02_i_03df6f1f988e665d9]
  ok: [myclusterSomeServer03_i_057dfr56u88e665d9]
  ...
  .....more...this time it worked for all servers.
  </code></pre>
  
  <p>As you see above, this time the above step worked fine. The same issue (SSH connection timed out) is happening during some task/actions (where I'm trying to install something using Ansible <code>yum</code> module. If I try it again, it works fine for the server which failed last time but then it may fail for another server which was successful last time. Thus, the behavior is random.</p>
  
  <p>My /etc/ansible/ansible.cfg file has:</p>
  
  <pre><code>[ssh_connection]
  scp_if_ssh = True
  </code></pre>