# Call playbook from git

**URL:** <https://forum.ansible.com/t/call-playbook-from-git/2614>\
**Category:** Get Help\
**Tags:** git, ansible\
**Created:** [November 28, 2023, 11:29am UTC](https://forum.ansible.com/t/call-playbook-from-git/2614 "2023-11-28T11:29:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgab1](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@mgab1](https://forum.ansible.com/u/mgab1)\
**Post date:** [November 28, 2023, 11:29am UTC](https://forum.ansible.com/t/call-playbook-from-git/2614/1 "2023-11-28T11:29:24Z")

</div>

Hi all,

Just a “quick question”  
Is it possible to directly “call” an ansible playbook which is stored in git without downloading it prior ?

So the idea is to have all the playbooks stored in our internal git-repo and to “call” them ( something ) like this:

ansible-playbook git://user:pass@our-git.com/repo/branch/myPlaybook.yaml

---

<div class="post-metadata">

**Author:** ![kpfleming](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@kpfleming](https://forum.ansible.com/u/kpfleming)\
**Post date:** [November 28, 2023, 11:56am UTC](https://forum.ansible.com/t/call-playbook-from-git/2614/2 "2023-11-28T11:56:57Z")

</div>

No, I don’t believe this is possible.

---

<div class="post-metadata">

**Author:** ![mgab1](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@mgab1](https://forum.ansible.com/u/mgab1)\
**Post date:** [November 28, 2023, 12:12pm UTC](https://forum.ansible.com/t/call-playbook-from-git/2614/3 "2023-11-28T12:12:29Z")

</div>

ok 😪  
Thanks for your help

---

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [November 28, 2023, 12:15pm UTC](https://forum.ansible.com/t/call-playbook-from-git/2614/4 "2023-11-28T12:15:04Z")

</div>

You could mount the repo locally and then run Ansible?

I have never used `gitfs` and it hasn’t had a release since 2019 so there might be a better way of doing this, but in theory this would work:

[https://github.com/presslabs/gitfs](https://github.com/presslabs/gitfs)

---

<div class="post-metadata">

**Author:** ![ptn](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ptn/32/481_2.png) [@ptn](https://forum.ansible.com/u/ptn)\
**Post date:** [November 28, 2023, 4:36pm UTC](https://forum.ansible.com/t/call-playbook-from-git/2614/5 "2023-11-28T16:36:43Z")

</div>

Hi,

Not without downloading per se, nor through pure git, but you can pass your remote playbook to stdin while fetching its raw content in http, if you git hosting provider allows for it; example for a playbook I ran from a Github repo:

```bash
curl -Ls https://raw.githubusercontent.com/myusername/myrepo/mybranch/my/playbook/path?token=mytoken | ansible-playbook -i /my/inventories/path/ /dev/stdin

```

---

<div class="post-metadata">

**Author:** ![kpfleming](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@kpfleming](https://forum.ansible.com/u/kpfleming)\
**Post date:** [November 28, 2023, 5:47pm UTC](https://forum.ansible.com/t/call-playbook-from-git/2614/6 "2023-11-28T17:47:20Z")

</div>

This will also limit you to only using playbooks that are a single file; while it’s probably not common, playbooks are permitted to refer to ‘local’ content (templates, plugins, etc.) like a role can have, and pulling a single file from a repository won’t support that.
