# Using inventory shortcut -i "host," on ansible 1.5

**URL:** <https://forum.ansible.com/t/using-inventory-shortcut-i-host-on-ansible-1-5/14698>\
**Category:** Ansible Project\
**Created:** [March 4, 2014, 3:30pm UTC](https://forum.ansible.com/t/using-inventory-shortcut-i-host-on-ansible-1-5/14698 "2014-03-04T15:30:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dmitry\_Horbach](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@Dmitry\_Horbach](https://forum.ansible.com/u/Dmitry_Horbach)\
**Post date:** [March 4, 2014, 3:30pm UTC](https://forum.ansible.com/t/using-inventory-shortcut-i-host-on-ansible-1-5/14698/1 "2014-03-04T15:30:04Z")

</div>

Hi,

I guess it has something to do with new localhost feature of ansible 1.5

In playbook with  
hosts: localhost:host

if i specify -i “host,” the play will be done for both localhost and host

GATHERING FACTS \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost]  
ok: [oracle]

Is there any workaround for this situation?

---

<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:** [March 4, 2014, 3:33pm UTC](https://forum.ansible.com/t/using-inventory-shortcut-i-host-on-ansible-1-5/14698/2 "2014-03-04T15:33:12Z")

</div>

So in Ansible now, localhost is implicitly added to inventory. This means you can reference it and it will work.

Now “-i host,” is an ugly vestigial tail of Ansible, and I swear I want to cut it off, but I’m not willing to deal with the people that have come to rely on it being angry 🙂

We strongly encourage making inventory files and people should make inventory files.

That being said, what you have above works exactly the same as if you did

[foo]  
host

and did the same with regular Ansible, that was just my PSA about the evils of “-i host,” and this not being specific to that 🙂

So yes, this works exactly as it should.

You should defintely move to using inventory files, but “–limit hosts” should not include localhost in the above case.
