Trying to Clone Git Repo But Not Sure How to Handle RSA Keys

23 views
Skip to first unread message

Justin Neel

unread,
Oct 8, 2015, 11:32:36 AM10/8/15
to Ansible Project
Ok, so I'm somewhat new to running Vagrant. But I'm getting better. I've been using Ansible as my provisioner of choice. What I would like to do now is create a task that will run a git clone of a hosted repo. It's not github though. It's a little different. And I can't seem to figure out how to handle doing this.

If I was doing it manually I would run...

And then I would get...
The authenticity of host '[codeserver.dev234w31d6b-34fd-4a21-2b35-92346de84a7d1.drush.in]:2222 ([2234:4341:7234:2:be32:4cdd:fd10:792]:2222)' can't be established.
RSA key fingerprint is c5:fa:33:cb:7g:2b:0d:33:c2:13:27:22:ea:70:c1:a5.
Are you sure you want to continue connecting (yes/no)? 

I would type yes and then my password, and then i would get a clone of my repo.

I just can't quite figure out how to do this with Ansible. I tried something like below, but I clearly need to do more. 

- name: Clone Pantheon repo
  git: repo=ssh://something.dev.234w31d6b-34...@something.dev.234w31d6b-34fd-4a21-2b35-92346de84a7d1.drush.in:2222/~/repository.git accept_hostkey=yes force=yes dest=/var/www version=master

I even tried adding this before it...

- name: ensure pantheon is a known host

I think I'm pretty lost. If anyone can help straighten me out, I would appreciate it.

Kevin Bullock

unread,
Oct 8, 2015, 11:36:50 AM10/8/15
to ansible...@googlegroups.com
On Oct 8, 2015, at 10:27, Justin Neel <justi...@gmail.com> wrote:

Ok, so I'm somewhat new to running Vagrant. But I'm getting better. I've been using Ansible as my provisioner of choice. What I would like to do now is create a task that will run a git clone of a hosted repo. It's not github though. It's a little different. And I can't seem to figure out how to handle doing this.

If I was doing it manually I would run...

And then I would get...
The authenticity of host '[codeserver.dev234w31d6b-34fd-4a21-2b35-92346de84a7d1.drush.in]:2222 ([2234:4341:7234:2:be32:4cdd:fd10:792]:2222)' can't be established.
RSA key fingerprint is c5:fa:33:cb:7g:2b:0d:33:c2:13:27:22:ea:70:c1:a5.
Are you sure you want to continue connecting (yes/no)? 

I would type yes and then my password, and then i would get a clone of my repo.

The host key is likely not your problem—having to enter a password is. Ansible expects to be able to clone repos unattended. Does your host let you add an SSH public key that you can use to authenticate?

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock

Reply all
Reply to author
Forward
0 new messages