# \--limit \[exclusive:inclusive\] not working as expected

**URL:** <https://forum.ansible.com/t/limit-exclusive-inclusive-not-working-as-expected/26627>\
**Category:** Ansible Project\
**Created:** [February 1, 2018, 8:49pm UTC](https://forum.ansible.com/t/limit-exclusive-inclusive-not-working-as-expected/26627 "2018-02-01T20:49:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Cavedon](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@Mike\_Cavedon](https://forum.ansible.com/u/Mike_Cavedon)\
**Post date:** [February 1, 2018, 8:49pm UTC](https://forum.ansible.com/t/limit-exclusive-inclusive-not-working-as-expected/26627/1 "2018-02-01T20:49:44Z")

</div>

I have the following hosts defined:

[router]  
rr01  
rr[03:99]  
rr[100:114]

I then execute a command that contains “–limit router[39:49]”. Hosts rr41 through rr51 have the command executed on them. I’m expecting the command to be executed on hosts rr41 through rr50. Why does the command execute on host rr51?

Thanks.

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [February 1, 2018, 9:02pm UTC](https://forum.ansible.com/t/limit-exclusive-inclusive-not-working-as-expected/26627/2 "2018-02-01T21:02:48Z")

</div>

It's start on 0 not 1  
router[0] = rr01

---

<div class="post-metadata">

**Author:** ![Mike\_Cavedon](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@Mike\_Cavedon](https://forum.ansible.com/u/Mike_Cavedon)\
**Post date:** [February 1, 2018, 9:28pm UTC](https://forum.ansible.com/t/limit-exclusive-inclusive-not-working-as-expected/26627/3 "2018-02-01T21:28:46Z")

</div>

Is it [inclusive:inclusive], or is it [exclusive:inclusive]? I seem to recall the first parameter was exclusive. Maybe that was when [exclusive,inclusive] was supported?

If I have:

[router]  
rr[01:99]

How do I deploy to hosts rr39 through rr49?

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [February 1, 2018, 9:35pm UTC](https://forum.ansible.com/t/limit-exclusive-inclusive-not-working-as-expected/26627/4 "2018-02-01T21:35:57Z")

</div>

It's inclusive:inclusive.  
Since it start with 0 rr39 is 38 and rr49 is 48 so -l router[38:48]

---

<div class="post-metadata">

**Author:** ![Mike\_Cavedon](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@Mike\_Cavedon](https://forum.ansible.com/u/Mike_Cavedon)\
**Post date:** [February 1, 2018, 9:53pm UTC](https://forum.ansible.com/t/limit-exclusive-inclusive-not-working-as-expected/26627/5 "2018-02-01T21:53:12Z")

</div>

Thanks. I asked another question about what appears to be a bug in the doc.
