# Distributed Ansible Playbooks

**URL:** <https://forum.ansible.com/t/distributed-ansible-playbooks/19081>\
**Category:** Ansible Project\
**Created:** [August 21, 2015, 12:39pm UTC](https://forum.ansible.com/t/distributed-ansible-playbooks/19081 "2015-08-21T12:39:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeremy](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@Jeremy](https://forum.ansible.com/u/Jeremy)\
**Post date:** [August 21, 2015, 12:39pm UTC](https://forum.ansible.com/t/distributed-ansible-playbooks/19081/1 "2015-08-21T12:39:24Z")

</div>

I recently had a conversation with some developers about the possibility of taking our existing ansible repo and breaking it up across many different repos. I am not sure if this is possible, so I decided to pose it to this group.

We have all of our playbooks to build our environment and deploy our applications in one central repository. This has been working well for us, but if a developer needs a change they are typically modifying the code in their repo and some variables or code in the ansible repo. Then we need to coordinate the release of ansible changes with their code through the environments. They have asked if we could place the ansible playbook required to build and deploy each application in their code repo. This way, we could maintain everything in one repo and version code and deployment changes to go out together.

I’m still trying to work through how this could work to build the complete environment that would span several repos. We also use Tower and I’m unsure if that would cause any issues. Is anyone trying to or successfully done this? Is it even possible? Thanks.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [August 21, 2015, 2:08pm UTC](https://forum.ansible.com/t/distributed-ansible-playbooks/19081/2 "2015-08-21T14:08:56Z")

</div>

It is not hard, it is easier if you have a convention on the playbook  
names (build.yml, deploy.yml), then you just need a list of the apps  
and their repo locations:

apps:  
&nbsp;&nbsp;- app1: git://internal/repo/app1.git

and a playbook that goes over this list, checks out all the apps and  
then runs build.yml and deploy.yml for each.

If you don't standardize the names, add them to the vars file above:

apps:  
&nbsp;&nbsp;&nbsp;app1:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;src: git://internal/repo/app1.git  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;build: make.yml  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;deploy: push.yml

---

<div class="post-metadata">

**Author:** ![Jeremy](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@Jeremy](https://forum.ansible.com/u/Jeremy)\
**Post date:** [August 21, 2015, 5:42pm UTC](https://forum.ansible.com/t/distributed-ansible-playbooks/19081/3 "2015-08-21T17:42:40Z")

</div>

Thanks for the quick feedback. We may start moving forward with this shortly. Hopefully I’ll have some lessons learned that I can share later.

---

<div class="post-metadata">

**Author:** ![Jeffrey\_Lee](https://avatars.discourse-cdn.com/v4/letter/j/e36b37/32.png) [@Jeffrey\_Lee](https://forum.ansible.com/u/Jeffrey_Lee)\
**Post date:** [August 28, 2015, 8:10pm UTC](https://forum.ansible.com/t/distributed-ansible-playbooks/19081/4 "2015-08-28T20:10:01Z")

</div>

Hi Jeremy and Brian,

I’m looking into a similar set up however, what we’d like to do is have a repo per Ansible Role (eg apache, php, tomcat, java) so we can be working on different roles at the same time without git conflicts being thrown at us. Right now what we have is one repo with all of our roles in one repo and multiple people working on different roles. We would also like to be able to tag each role with different versions of the role. The problem right now is that if we want to assemble an Ansible package with a combination of these roles and their version numbers, we are unable to do that. We are not using Ansible Tower. Any suggestions?

Best,

Jeff
