# Syntax for limiting to batches?

**URL:** <https://forum.ansible.com/t/syntax-for-limiting-to-batches/19852>\
**Category:** Ansible Project\
**Created:** [November 25, 2015, 3:34pm UTC](https://forum.ansible.com/t/syntax-for-limiting-to-batches/19852 "2015-11-25T15:34:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc\_Abramowitz](https://avatars.discourse-cdn.com/v4/letter/m/a5b964/32.png) [@Marc\_Abramowitz](https://forum.ansible.com/u/Marc_Abramowitz)\
**Post date:** [November 25, 2015, 3:34pm UTC](https://forum.ansible.com/t/syntax-for-limiting-to-batches/19852/1 "2015-11-25T15:34:54Z")

</div>

Using the "serial:" keyword so ansible can do hosts in batches.

Wondering if there is support for addressing those batches - e.g.: -l dbservers@batch1 or something like that

Use case is folks want to run a job to do half the nodes; then pause for manual QA; then run another job for the other half of the nodes.

Maintaining groups with the batches in inventory seems a little cumbersome. It would be cool to leverage Ansible's ability to split the hosts into batches.

---

<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:** [November 26, 2015, 5:59am UTC](https://forum.ansible.com/t/syntax-for-limiting-to-batches/19852/2 "2015-11-26T05:59:32Z")

</div>

you could whip up something like:  
groups['dbservers'][:groups['dbservers']|len/2]  
groups['dbservers'][groups['dbservers']|len/2:]

currently there is no var for tracking the split groups other than  
'current one' which is play\_hosts
