# Is it possible to specify hosts when including a nested playbook?

**URL:** <https://forum.ansible.com/t/is-it-possible-to-specify-hosts-when-including-a-nested-playbook/20304>\
**Category:** Ansible Project\
**Created:** [January 21, 2016, 12:38pm UTC](https://forum.ansible.com/t/is-it-possible-to-specify-hosts-when-including-a-nested-playbook/20304 "2016-01-21T12:38:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Edd\_Grant](https://avatars.discourse-cdn.com/v4/letter/e/cab0a1/32.png) [@Edd\_Grant](https://forum.ansible.com/u/Edd_Grant)\
**Post date:** [January 21, 2016, 12:38pm UTC](https://forum.ansible.com/t/is-it-possible-to-specify-hosts-when-including-a-nested-playbook/20304/1 "2016-01-21T12:38:34Z")

</div>

I have an ‘all-hosts’ playbook which contains logic common to all hosts. This playbook is nested as an include in several top-level playbooks (for example deploy-application-x and deploy-application-y). When I run each of these top level playbooks I want to limit the hosts on which all-hosts runs to just the hosts defined in the top level playbook.

Here’s a slightly contrived example in code:

#deploy-app-x.yml
