# Playbooks that depend on other playbooks?

**URL:** <https://forum.ansible.com/t/playbooks-that-depend-on-other-playbooks/16480>\
**Category:** Ansible Project\
**Created:** [October 9, 2014, 8:42pm UTC](https://forum.ansible.com/t/playbooks-that-depend-on-other-playbooks/16480 "2014-10-09T20:42:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cody\_Krieger](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@Cody\_Krieger](https://forum.ansible.com/u/Cody_Krieger)\
**Post date:** [October 9, 2014, 8:42pm UTC](https://forum.ansible.com/t/playbooks-that-depend-on-other-playbooks/16480/1 "2014-10-09T20:42:26Z")

</div>

Hi all,

I’ve got a couple of playbooks that depend on other playbooks in order to eliminate as much repetition as possible. For example, one playbook is responsible for basic server configuration, which is a dependency of other playbooks whose goals are to deploy specific apps/services on top of this base configuration.

My current strategy looks something like this:

- playbook b depends on playbook a
- playbook b has playbook a as a git submodule in vendor/a
- playbook b’s site.yml includes vendor/a/site.yml before playbook b’s roles are declared, in order to make sure that playbook a runs first

This sort of works, but it feels kind of janky. One of the biggest downsides to this is that sub-playbooks don’t have their group\_vars evaluated — only the top-level playbook’s group\_vars are evaluated. This effectively means that anything defined in group\_vars in any of the sub-playbooks has to be copied up to the top-level playbook’s group\_vars.

Is there a better way to handle this?

Thanks,  
Cody

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [October 9, 2014, 9:23pm UTC](https://forum.ansible.com/t/playbooks-that-depend-on-other-playbooks/16480/2 "2014-10-09T21:23:14Z")

</div>

When you say depends, I assume you are meaning you are using playbook includes, so the provisioning playbook includes the “config” playbook?

---

<div class="post-metadata">

**Author:** ![Cody\_Krieger](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@Cody\_Krieger](https://forum.ansible.com/u/Cody_Krieger)\
**Post date:** [October 13, 2014, 11:51pm UTC](https://forum.ansible.com/t/playbooks-that-depend-on-other-playbooks/16480/3 "2014-10-13T23:51:46Z")

</div>

That’s correct.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [October 20, 2014, 9:20pm UTC](https://forum.ansible.com/t/playbooks-that-depend-on-other-playbooks/16480/4 "2014-10-20T21:20:44Z")

</div>

Thanks for clarification – it’s not a dependency then.

“One of the biggest downsides to this is that sub-playbooks don’t have their group\_vars evaluated — only the top-level playbook’s group\_vars are evaluated.”

I’m not processing this part of the email unfortunately, as group\_vars/ is an inventory concept.
