# limit/subset as variable

**URL:** <https://forum.ansible.com/t/limit-subset-as-variable/17094>\
**Category:** Ansible Project\
**Created:** [December 17, 2014, 10:53pm UTC](https://forum.ansible.com/t/limit-subset-as-variable/17094 "2014-12-17T22:53:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adham\_H](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Adham\_H](https://forum.ansible.com/u/Adham_H)\
**Post date:** [December 17, 2014, 10:53pm UTC](https://forum.ansible.com/t/limit-subset-as-variable/17094/1 "2014-12-17T22:53:52Z")

</div>

Hi,

I have play that includes another play

apps.yml  
`

- name: apps.yml | provision  
hosts: apps  
include: provision.yml

- name: apps.yml | common stuff  
hosts: apps  
roles:

- do\_common\_stuff

`  
provision.yml

`

- hosts: “{{subset\_var}}”  
connection: local  
gather\_facts: no  
pre\_tasks:

- name: do some stuff  
dosome\_tasks  
roles:

- { role: do\_some\_provisioning }

- { role: do\_more\_stuff}

- { role: maybe\_also\_dns}

`

The concept is that provision will be called from different plays for different groups and the provision play will take the subset of the parent play.

If you have a solution that does not involve passing “-e” it would be great to share

---

<div class="post-metadata">

**Author:** ![Adham\_H](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Adham\_H](https://forum.ansible.com/u/Adham_H)\
**Post date:** [December 17, 2014, 10:57pm UTC](https://forum.ansible.com/t/limit-subset-as-variable/17094/2 "2014-12-17T22:57:33Z")

</div>

Sorry i just realized there is a simlear question [https://groups.google.com/forum/#!topic/ansible-project/c8bdwPtR640](https://groups.google.com/forum/#!topic/ansible-project/c8bdwPtR640)
