# Nesting Playbooks?

**URL:** <https://forum.ansible.com/t/nesting-playbooks/19813>\
**Category:** Ansible Project\
**Created:** [November 19, 2015, 11:58pm UTC](https://forum.ansible.com/t/nesting-playbooks/19813 "2015-11-19T23:58:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Levitt](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@Jason\_Levitt](https://forum.ansible.com/u/Jason_Levitt)\
**Post date:** [November 19, 2015, 11:58pm UTC](https://forum.ansible.com/t/nesting-playbooks/19813/1 "2015-11-19T23:58:35Z")

</div>

Ansible v1.9.4

I have a playbook that I launch with:

`$ ansible-playbook build.yml`

build.yml includes set\_os.yml (just a set of tasks) that launches some ec2 instances. build.yml looks like this.

`

- name: Build stuff  
hosts: localhost  
remote\_user: ec2-user  
sudo: False  
gather\_facts: False  
tasks:
- include: set\_os.yml
- include: build\_soft.yml  
`

At the end of build.yml above, I also include build\_soft.yml which is another playbook:

`

---

<div class="post-metadata">

**Author:** ![Timothy\_Gerla](https://avatars.discourse-cdn.com/v4/letter/t/977dab/32.png) [@Timothy\_Gerla](https://forum.ansible.com/u/Timothy_Gerla)\
**Post date:** [November 20, 2015, 1:43am UTC](https://forum.ansible.com/t/nesting-playbooks/19813/2 "2015-11-20T01:43:32Z")

</div>

Since build\_soft.yml is a full playbook and not just a list of tasks, like set\_os.yml, the include shouldn’t be indented to the same level. Try de-denting the build\_soft.yml as far left as possible, and it should behave as expected.

-Tim

---

<div class="post-metadata">

**Author:** ![Jason\_Levitt](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@Jason\_Levitt](https://forum.ansible.com/u/Jason_Levitt)\
**Post date:** [November 20, 2015, 4:49pm UTC](https://forum.ansible.com/t/nesting-playbooks/19813/3 "2015-11-20T16:49:39Z")

</div>

That was it. Thanks.

J
