# include\_playbook / include tasks from Bitbucket?

**URL:** <https://forum.ansible.com/t/include-playbook-include-tasks-from-bitbucket/29923>\
**Category:** Ansible Project\
**Created:** [March 20, 2019, 2:25pm UTC](https://forum.ansible.com/t/include-playbook-include-tasks-from-bitbucket/29923 "2019-03-20T14:25:18Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![TOB](https://avatars.discourse-cdn.com/v4/letter/t/a88e57/32.png) [@TOB](https://forum.ansible.com/u/TOB)\
**Post date:** [March 20, 2019, 2:25pm UTC](https://forum.ansible.com/t/include-playbook-include-tasks-from-bitbucket/29923/1 "2019-03-20T14:25:18Z")

</div>

Hi everyone,

short summary: I have a playbook from where I wanna start other playbooks hosted on Bitbucket. In short words: Got a server and want to clone repository on Bitbucket where are all the other playbooks which I want to run on the remote server.

`

---

<div class="post-metadata">

**Author:** ![Michael\_M1](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@Michael\_M1](https://forum.ansible.com/u/Michael_M1)\
**Post date:** [March 20, 2019, 2:29pm UTC](https://forum.ansible.com/t/include-playbook-include-tasks-from-bitbucket/29923/2 "2019-03-20T14:29:27Z")

</div>

There is a git module for this purpose which may work better for you.

[https://docs.ansible.com/ansible/latest/modules/git\_module.html#git-module](https://docs.ansible.com/ansible/latest/modules/git_module.html#git-module)

---

<div class="post-metadata">

**Author:** ![TOB](https://avatars.discourse-cdn.com/v4/letter/t/a88e57/32.png) [@TOB](https://forum.ansible.com/u/TOB)\
**Post date:** [March 20, 2019, 2:36pm UTC](https://forum.ansible.com/t/include-playbook-include-tasks-from-bitbucket/29923/3 "2019-03-20T14:36:50Z")

</div>

Hi Michael,

thanks for your answer. I’m already using it, it’s in the first code block above.

Best

---

<div class="post-metadata">

**Author:** ![Michael\_M1](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@Michael\_M1](https://forum.ansible.com/u/Michael_M1)\
**Post date:** [March 20, 2019, 2:49pm UTC](https://forum.ansible.com/t/include-playbook-include-tasks-from-bitbucket/29923/4 "2019-03-20T14:49:36Z")

</div>

Sorry, yes, too early for clear thinking. 😉

I was thinking of ansible-pull. I know Brian Coca that frequents this forum had a github or galaxy entry on the subject some time ago but I can’t seem to find it. But this is a good reference (or you can just do a ‘man ansible-pull’):

[http://manpages.ubuntu.com/manpages/trusty/man1/ansible-pull.1.html](http://manpages.ubuntu.com/manpages/trusty/man1/ansible-pull.1.html)

---

<div class="post-metadata">

**Author:** ![TOB](https://avatars.discourse-cdn.com/v4/letter/t/a88e57/32.png) [@TOB](https://forum.ansible.com/u/TOB)\
**Post date:** [March 20, 2019, 3:05pm UTC](https://forum.ansible.com/t/include-playbook-include-tasks-from-bitbucket/29923/5 "2019-03-20T15:05:03Z")

</div>

Good morning then! 🙂

I’ll take a look. The weird thing is following: The remote server is cloning the files (checked it manually if they’re there) but with “include\_tasks” or “import\_playbook” I’m not able to execute the playbooks lying around there.

---

<div class="post-metadata">

**Author:** ![Michael\_M1](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@Michael\_M1](https://forum.ansible.com/u/Michael_M1)\
**Post date:** [March 21, 2019, 12:52am UTC](https://forum.ansible.com/t/include-playbook-include-tasks-from-bitbucket/29923/6 "2019-03-21T00:52:21Z")

</div>

Yeah I have not tried to execute a playbook like that so I don’t have anything to offer there. I’ve done your exact scenerio though using ansible-pull to run a playbook from my BitBucket repo.

---

<div class="post-metadata">

**Author:** ![TOB](https://avatars.discourse-cdn.com/v4/letter/t/a88e57/32.png) [@TOB](https://forum.ansible.com/u/TOB)\
**Post date:** [March 21, 2019, 7:46am UTC](https://forum.ansible.com/t/include-playbook-include-tasks-from-bitbucket/29923/7 "2019-03-21T07:46:44Z")

</div>

Okay, going to take a look on it - thanks. Do you know if it’s possible to use pull on Ansible AWX?

---

<div class="post-metadata">

**Author:** ![Michael\_M1](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@Michael\_M1](https://forum.ansible.com/u/Michael_M1)\
**Post date:** [March 21, 2019, 2:20pm UTC](https://forum.ansible.com/t/include-playbook-include-tasks-from-bitbucket/29923/8 "2019-03-21T14:20:05Z")

</div>

Yes, AWX let you use any kind of remote repo as a data source. Although I have not used it in a couple of years.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [April 23, 2019, 2:54am UTC](https://forum.ansible.com/t/include-playbook-include-tasks-from-bitbucket/29923/9 "2019-04-23T02:54:49Z")

</div>

Ansible CANNOT read the files on the remote as part of the playbook,  
you need to either check them out on the controller (git +  
delegate\_to: localhost) or 'fetch' them via the module with the same  
name.

AWX will just checkout that repo onto the AWX machine and run Ansible  
'locally' on those files, either way works

---

<div class="post-metadata">

**Author:** ![P\_Varsha](https://avatars.discourse-cdn.com/v4/letter/p/e274bd/32.png) [@P\_Varsha](https://forum.ansible.com/u/P_Varsha)\
**Post date:** [April 23, 2019, 6:11am UTC](https://forum.ansible.com/t/include-playbook-include-tasks-from-bitbucket/29923/10 "2019-04-23T06:11:21Z")

</div>

hello,

Once check your file location.
