# Trying to git clone from private repo on GitHub

**URL:** <https://forum.ansible.com/t/trying-to-git-clone-from-private-repo-on-github/13826>\
**Category:** Ansible Project\
**Created:** [November 1, 2013, 10:15pm UTC](https://forum.ansible.com/t/trying-to-git-clone-from-private-repo-on-github/13826 "2013-11-01T22:15:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jay\_Pipes](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@Jay\_Pipes](https://forum.ansible.com/u/Jay_Pipes)\
**Post date:** [November 1, 2013, 10:15pm UTC](https://forum.ansible.com/t/trying-to-git-clone-from-private-repo-on-github/13826/1 "2013-11-01T22:15:15Z")

</div>

Hello all,

I’m trying to git clone a private repo from GitHub in an Ansible playbook, and the playbook is hanging trying to git clone. I’ve added the SSH key that is being used for the user running Ansible as a Deploy Key in the private repo, but still am not having any luck. It’s like the key is not being forwarded or something…

Has anyone had any luck git cloning a private GitHub repo, and if so, would you care to share your playbook or a snippet of it?

Thanks very much in advance!  
-jay

---

<div class="post-metadata">

**Author:** ![Jim\_Richardson](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@Jim\_Richardson](https://forum.ansible.com/u/Jim_Richardson)\
**Post date:** [November 1, 2013, 10:30pm UTC](https://forum.ansible.com/t/trying-to-git-clone-from-private-repo-on-github/13826/2 "2013-11-01T22:30:42Z")

</div>

can you do the clone manually with the same key as the same user?

---

<div class="post-metadata">

**Author:** ![Jay\_Pipes](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@Jay\_Pipes](https://forum.ansible.com/u/Jay_Pipes)\
**Post date:** [November 2, 2013, 12:39am UTC](https://forum.ansible.com/t/trying-to-git-clone-from-private-repo-on-github/13826/3 "2013-11-02T00:39:33Z")

</div>

Yes, that works.

---

<div class="post-metadata">

**Author:** ![gustavo\_giudici](https://avatars.discourse-cdn.com/v4/letter/g/ea666f/32.png) [@gustavo\_giudici](https://forum.ansible.com/u/gustavo_giudici)\
**Post date:** [March 11, 2015, 3:10pm UTC](https://forum.ansible.com/t/trying-to-git-clone-from-private-repo-on-github/13826/4 "2015-03-11T15:10:26Z")

</div>

for future googlers, this issue can be solved by setting sudo:false in the role or playbook that is doing the git task
