<h5 dir="auto">Issue Type:</h5>
<p dir="auto">Bug Report</p>
<h5 dir="auto">Ansible Version:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ansible --version
ansible 1.8.1"><pre class="notranslate"><code class="notranslate">$ ansible --version
ansible 1.8.1
</code></pre></div>
<h5 dir="auto">Environment:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ uname -a
Darwin 0x6D67 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64 i386 MacBookPro11,3 Darwin"><pre class="notranslate"><code class="notranslate">$ uname -a
Darwin 0x6D67 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64 i386 MacBookPro11,3 Darwin
</code></pre></div>
<h5 dir="auto">Summary:</h5>
<p dir="auto">Since 1.8.1 update, one of my git commands hangs forever.</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- name: bar | Checkout project
  sudo: yes
  git: repo=git@github.com:foo/bar.git accept_hostkey=True
       force=yes remote=origin version=master
       dest=/srv/www/foo/bar"><pre class="notranslate"><code class="notranslate">- name: bar | Checkout project
  sudo: yes
  git: repo=git@github.com:foo/bar.git accept_hostkey=True
       force=yes remote=origin version=master
       dest=/srv/www/foo/bar
</code></pre></div>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">It's working with ansible <code class="notranslate">v1.7.2</code></p>
<h5 dir="auto">Actual Results:</h5>
<p dir="auto">The task hangs, if I ssh and check the folder, it looks like it crashes on a submodule:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Submodule 'webroot/modules/col-stats' () registered for path 'webroot/modules/col-stats'
fatal: Needed a single revision
Unable to find current revision in submodule path 'webroot/modules/col-broadcast-viewer'"><pre class="notranslate"><code class="notranslate">Submodule 'webroot/modules/col-stats' () registered for path 'webroot/modules/col-stats'
fatal: Needed a single revision
Unable to find current revision in submodule path 'webroot/modules/col-broadcast-viewer'
</code></pre></div>
<p dir="auto">Can't reproduce it with the CLI:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="git clone -o github git@github.com:foo/bar.git --recursive"><pre class="notranslate"><code class="notranslate">git clone -o github git@github.com:foo/bar.git --recursive
</code></pre></div>
<p dir="auto">When executing the <code class="notranslate">git</code> command, with <code class="notranslate">recursive: yes</code>, the <code class="notranslate">accept_hostkey: yes</code> directive is ignored for submodules. If the submodule remote is a different server to the main git repo, the Ansible script hangs waiting for manual authentication of the remote.</p>