# Limit the number of hosts, or using \[x\] on groups intersection

**URL:** <https://forum.ansible.com/t/limit-the-number-of-hosts-or-using-x-on-groups-intersection/18900>\
**Category:** Ansible Project\
**Created:** [July 30, 2015, 10:08am UTC](https://forum.ansible.com/t/limit-the-number-of-hosts-or-using-x-on-groups-intersection/18900 "2015-07-30T10:08:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tzach\_Livyatan1](https://avatars.discourse-cdn.com/v4/letter/t/9fc29f/32.png) [@Tzach\_Livyatan1](https://forum.ansible.com/u/Tzach_Livyatan1)\
**Post date:** [July 30, 2015, 10:08am UTC](https://forum.ansible.com/t/limit-the-number-of-hosts-or-using-x-on-groups-intersection/18900/1 "2015-07-30T10:08:26Z")

</div>

Hello  
My real desire is to limit the number of hosts for a playbook.  
Since --limit does not support that (AFAIK), I’m using A[0-x] for this, but here is the thing:  
My playbook limit the hosts to A:&B  
I would like to do something like : --limt “(A:&B)[0-x]”, in the CLI, limiting the number of host in the intersection of A and B.  
A[0-x]:&B, A:&B[0-x] or even A[0-x]:&B[0-x] does not provide this.

Any advice?
