title: Ansible Mercurial clone hangs
body: <p>When I try to clone a repository from Bitbucket with Ansible, it seems like the task 'hangs'.</p>
  
  <p>In the <a href="http://ansible.cc/docs/modules.html#hg" rel="nofollow">documentation</a> I have found some information, but I'm not using SSH.</p>
  
  <blockquote>
    <p>If the task seems to be hanging, first verify remote host is in
    known_hosts. SSH will prompt user to authorize the first contact with
    a remote host. One solution is to add StrictHostKeyChecking no in
    .ssh/config which will accept and authorize the connection on behalf
    of the user. However, if you run as a different user such as setting
    sudo to True), for example, root will not look at the user .ssh/config
    setting.</p>
  </blockquote>
  
  <p>These are the two Playbooks I've tried. They both 'hangs'.</p>
  
  <h2>Playbook #1</h2>
  
  <pre><code>- hosts: staging_mysql
    user: ec2-user
    sudo: yes
  
    vars_files:
      - vars/mercurial.yml
  
    tasks:
      - name: Mercurial credentials setup
        action: template src=templates/hgrc.j2 dest=/home/ec2-user/.hgrc
  
      - name: Install Mercurial
        action: yum name=hg
  
      - name: Setup API repository
        action: command hg clone https://bbusername@bitbucket.org/username/my-repo -r default --debug
  </code></pre>
  
  <h2>Playbook #2</h2>
  
  <pre><code>- hosts: staging_mysql
    user: ec2-user
    sudo: yes
  
    vars_files:
      - vars/mercurial.yml
  
    tasks:
      - name: Mercurial credentials setup
        action: template src=templates/hgrc.j2 dest=/home/ec2-user/.hgrc
  
      - name: Install Mercurial
        action: yum name=hg
  
      - name: Clone API repo
        hg: dest=/home/ec2-user repo=https://bbusername@bitbucket.org/username/my-repo
  </code></pre>
  
  <p>Any help is welcome. Thanks in advance!</p>