# limit now working as expected with multiple host sections

**URL:** <https://forum.ansible.com/t/limit-now-working-as-expected-with-multiple-host-sections/16178>\
**Category:** Ansible Project\
**Created:** [September 11, 2014, 4:01am UTC](https://forum.ansible.com/t/limit-now-working-as-expected-with-multiple-host-sections/16178 "2014-09-11T04:01:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Schurenko](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@Matt\_Schurenko](https://forum.ansible.com/u/Matt_Schurenko)\
**Post date:** [September 11, 2014, 4:01am UTC](https://forum.ansible.com/t/limit-now-working-as-expected-with-multiple-host-sections/16178/1 "2014-09-11T04:01:08Z")

</div>

Is this the correct behavior of using --limit:

{  
$ cat test\_inv  
[localhost]  
localhost

[foobar]  
localhost

$ cat test.yml

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [September 11, 2014, 2:29pm UTC](https://forum.ansible.com/t/limit-now-working-as-expected-with-multiple-host-sections/16178/2 "2014-09-11T14:29:51Z")

</div>

The short answer is: maybe, but it’s probably more important that it’s considered a feature.

Often in configuring sets of machines, needing to run things locally is required to do some steps once and then apply them to a batch.

Thus, almost never do you treat the control machine as “one of the regular nodes”. For instance, if configuring webservers, you do not run ansible _from_ one of the webservers, so the behavior of the localhost in that play should be innocous relative to the hosts being configured.

I think removing this would break some rather fundamental use cases with --limit.

I do understand it’s common to run configuration against localhost in development or for testing, and in this case I’d recommend splitting inventories.
