The git module contains some logic to auto-accept the hostkey. Looks like you'll need to manually add it before the checkout since this hasn't been added there yet.
(Pull requests would be welcome - take a look at the git module for details). On Thu, May 22, 2014 at 10:25 PM, linbo liao <[email protected]> wrote: > Haven't used hg, but for git, two solutions: > > 1. add password in repo url, like: https://bbusername:password@ > bitbucket.org/username/my-repo<https://[email protected]/username/my-repo> > > > 2. setup ssh key, git module has ssh key option. > > Now I am searching a solution to pass the password from terminal, like > enter ssh password in terminal when use ansible -u user -k, but no idea how > to solve it. > > Thanks, > Linbo > > 在 2013年5月9日星期四UTC+8下午4时27分09秒,Niels Dequeker写道: > >> Hello everyone >> >> I am starting with Ansible and I really like it so far. But at the moment >> I'm kinda stuck, because I can't clone from a repository. >> I have also posted this question on >> StackOverflow<http://stackoverflow.com/questions/16447834/ansible-mercurial-clone-hangs>, >> but it seems that there is more activity on this Google Usergroup. >> >> When I try to clone a repository from Bitbucket with Ansible, it seems >> like the task 'hangs'. >> In the I have found some information, but I'm not using SSH. >> >> 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. >> >> >> These are the two Playbooks I've tried. They both 'hang'. >> >> *Playbook #1* >> - 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 >> >> *Playbook #2* >> >> - 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 >> >> Any help is welcome as I'd like to continue with Ansible. Thanks in >> advance! >> > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/38ea70de-5b1f-455d-89f8-736cdf1cdbf0%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/38ea70de-5b1f-455d-89f8-736cdf1cdbf0%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzS2hQgpNwHJEO%3D%2BHZSje1344aCK8usP84S5cZDOBdsYw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
