# ansible-pull, GitHub private repository, deploy key

**URL:** <https://forum.ansible.com/t/ansible-pull-github-private-repository-deploy-key/17388>\
**Category:** Ansible Project\
**Created:** [January 28, 2015, 1:24am UTC](https://forum.ansible.com/t/ansible-pull-github-private-repository-deploy-key/17388 "2015-01-28T01:24:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Florin\_Andrei](https://avatars.discourse-cdn.com/v4/letter/f/c77e96/32.png) [@Florin\_Andrei](https://forum.ansible.com/u/Florin_Andrei)\
**Post date:** [January 28, 2015, 1:24am UTC](https://forum.ansible.com/t/ansible-pull-github-private-repository-deploy-key/17388/1 "2015-01-28T01:24:27Z")

</div>

I might be asking something obvious here, but anyway:

I’ve a private repo on GitHub, with an account on a read-only team there. I would like to run ansible-pull in one step with that repo, but I can’t seem to figure out how to tell ansible-pull to use the correct deploy key on GH. The git module in main ansible has options such as key\_file (and accept\_hostkey). There don’t seem to be analogues for ansible-pull.

A workaround would be to pull that repo some other way to localhost, then run ansible-playbook -c local. I don’t particularly like that - for a variety of reasons (not all of a technical nature) I’m looking for a minimalist solution: install ansible, drop one key file on the host, and append one short line to cron.

---

<div class="post-metadata">

**Author:** ![Giovanni\_Tirloni](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Giovanni\_Tirloni](https://forum.ansible.com/u/Giovanni_Tirloni)\
**Post date:** [January 28, 2015, 12:35pm UTC](https://forum.ansible.com/t/ansible-pull-github-private-repository-deploy-key/17388/2 "2015-01-28T12:35:44Z")

</div>

If I understand how ansible-pull works, it will do the git checkout and  
then call ansible-playbook.

You can try to specify private\_key\_file in ansible.cfg and see if  
ansible-playbook picks it up.

Giovanni

---

<div class="post-metadata">

**Author:** ![pjgo](https://avatars.discourse-cdn.com/v4/letter/p/d6d6ee/32.png) [@pjgo](https://forum.ansible.com/u/pjgo)\
**Post date:** [August 31, 2022, 9:09am UTC](https://forum.ansible.com/t/ansible-pull-github-private-repository-deploy-key/17388/3 "2022-08-31T09:09:28Z")

</div>

This subject seems to provoke speculation, but no working examples.
