# Limit playbook to a subset of servers, by count

**URL:** <https://forum.ansible.com/t/limit-playbook-to-a-subset-of-servers-by-count/18502>\
**Category:** Ansible Project\
**Created:** [June 15, 2015, 12:38pm UTC](https://forum.ansible.com/t/limit-playbook-to-a-subset-of-servers-by-count/18502 "2015-06-15T12:38:48Z")\
**Posts on this page:** 3\
**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:** [June 15, 2015, 12:38pm UTC](https://forum.ansible.com/t/limit-playbook-to-a-subset-of-servers-by-count/18502/1 "2015-06-15T12:38:48Z")

</div>

Hi  
I have Y running servers, and I would like to move a subset X to a different state.

Can I use something like  
ansible-playbook site.yml --limit 3

Where 3 is X, the number of server I want to apply the playbook on.

Thanks  
Tzach

---

<div class="post-metadata">

**Author:** ![Mark\_van\_der\_Hout](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@Mark\_van\_der\_Hout](https://forum.ansible.com/u/Mark_van_der_Hout)\
**Post date:** [June 19, 2015, 9:05am UTC](https://forum.ansible.com/t/limit-playbook-to-a-subset-of-servers-by-count/18502/2 "2015-06-19T09:05:37Z")

</div>

Hi Tzach,

I think you are looking for this kind of answer from Michael himself:

[https://groups.google.com/forum/#!msg/ansible-project/qfoeqytbRE4/SI58rlzeEwMJ](https://groups.google.com/forum/#!msg/ansible-project/qfoeqytbRE4/SI58rlzeEwMJ)

All the best!

---

<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:** [June 21, 2015, 9:37am UTC](https://forum.ansible.com/t/limit-playbook-to-a-subset-of-servers-by-count/18502/3 "2015-06-21T09:37:50Z")

</div>

Thanks Mark

`ansible-playbook example.yml --limit all[0%-10%]`

or

`ansible-playbook example.yml --limit all[0-4]`

Is what I was looking for!
