# Limit hosts for nested playbook

**URL:** <https://forum.ansible.com/t/limit-hosts-for-nested-playbook/22610>\
**Category:** Ansible Project\
**Created:** [September 22, 2016, 1:33am UTC](https://forum.ansible.com/t/limit-hosts-for-nested-playbook/22610 "2016-09-22T01:33:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![awiddersheim](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@awiddersheim](https://forum.ansible.com/u/awiddersheim)\
**Post date:** [September 22, 2016, 1:33am UTC](https://forum.ansible.com/t/limit-hosts-for-nested-playbook/22610/1 "2016-09-22T01:33:51Z")

</div>

Is it possible to limit the hosts that run against a nested playbook? For example, I have a site.yml file that includes other playbooks like so:

---

<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:** [September 22, 2016, 3:44pm UTC](https://forum.ansible.com/t/limit-hosts-for-nested-playbook/22610/2 "2016-09-22T15:44:50Z")

</div>

no

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [September 22, 2016, 4:19pm UTC](https://forum.ansible.com/t/limit-hosts-for-nested-playbook/22610/3 "2016-09-22T16:19:54Z")

</div>

I suggest you create some groups in your inventory, so instead of

- hosts: all

you run against

- hosts: webservers

(obviously webservers is just an example of a group).

This is nice when reading playbooks as you instantly get a notion of what roles are needed on the different types of server you are managing.

Hope this helps,

Jon
