# Choose host (localhost) without inventory file

**URL:** <https://forum.ansible.com/t/choose-host-localhost-without-inventory-file/13208>\
**Category:** Ansible Project\
**Created:** [July 28, 2013, 9:02am UTC](https://forum.ansible.com/t/choose-host-localhost-without-inventory-file/13208 "2013-07-28T09:02:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anatoly\_techtonik](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@anatoly\_techtonik](https://forum.ansible.com/u/anatoly_techtonik)\
**Post date:** [July 28, 2013, 9:02am UTC](https://forum.ansible.com/t/choose-host-localhost-without-inventory-file/13208/1 "2013-07-28T09:02:46Z")

</div>

Hi,

Is it possible to specify host to run playbook without creating hosts configuration file?

Thanks.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [July 28, 2013, 11:55am UTC](https://forum.ansible.com/t/choose-host-localhost-without-inventory-file/13208/2 "2013-07-28T11:55:14Z")

</div>

Technically yes, but it’s really not encouraged, as you can’t take advantage of group or host variables easily, or even name groups.

You can -i “[hostname.example.com](http://hostname.example.com),[hostname2.example.com](http://hostname2.example.com)”

In the case of specifying more than one host, it’s -i “[hostname.example.com](http://hostname.example.com),” … you just have to end in a trailing comma.
