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

**URL:** <https://forum.ansible.com/t/trying-to-clone-git-repo-but-not-sure-how-to-handle-rsa-keys/19465>\
**Category:** Ansible Project\
**Created:** [October 8, 2015, 3:27pm UTC](https://forum.ansible.com/t/trying-to-clone-git-repo-but-not-sure-how-to-handle-rsa-keys/19465 "2015-10-08T15:27:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justin\_Neel](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@Justin\_Neel](https://forum.ansible.com/u/Justin_Neel)\
**Post date:** [October 8, 2015, 3:27pm UTC](https://forum.ansible.com/t/trying-to-clone-git-repo-but-not-sure-how-to-handle-rsa-keys/19465/1 "2015-10-08T15:27:02Z")

</div>

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…**  
git clone ssh://something.dev.234w31d6b-34fd-4a21-2b35-92346de84a7d1@something.dev.234w31d6b-34fd-4a21-2b35-92346de84a7d1.drush.in:2222/~/repository.git burris-optics

**And then I would get…**

The authenticity of host ‘[codeserver.dev. 234w31d6b-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-34fd-4a21-2b35-92346de84a7d1@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  
action: sshknownhosts host=something.dev.234w31d6b-34fd-4a21-2b35-92346de84a7d1@something.dev.234w31d6b-34fd-4a21-2b35-92346de84a7d1.drush.in state=present port=2222

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

---

<div class="post-metadata">

**Author:** ![Kevin\_Bullock](https://avatars.discourse-cdn.com/v4/letter/k/f1d935/32.png) [@Kevin\_Bullock](https://forum.ansible.com/u/Kevin_Bullock)\
**Post date:** [October 8, 2015, 3:36pm UTC](https://forum.ansible.com/t/trying-to-clone-git-repo-but-not-sure-how-to-handle-rsa-keys/19465/2 "2015-10-08T15:36:43Z")

</div>

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
