# ansible --inventory option with a trailing comma

**URL:** <https://forum.ansible.com/t/ansible-inventory-option-with-a-trailing-comma/19606>\
**Category:** Ansible Project\
**Created:** [October 25, 2015, 12:53am UTC](https://forum.ansible.com/t/ansible-inventory-option-with-a-trailing-comma/19606 "2015-10-25T00:53:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![techraf](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@techraf](https://forum.ansible.com/u/techraf)\
**Post date:** [October 25, 2015, 12:53am UTC](https://forum.ansible.com/t/ansible-inventory-option-with-a-trailing-comma/19606/1 "2015-10-25T00:53:32Z")

</div>

Man pages for `ansible` and `ansible-playbook` define `-i` option as:

`

-i PATH, --inventory=PATH  
The PATH to the inventory hosts file, which defaults to  
/etc/ansible/hosts.

`

Yet to run on a local system the following syntax is used in examples:

`  
ansible -i “localhost,” -c local -m ping localhost

`

What exactly is this `"localhost,"` with a comma at the end (otherwise it is treated as filename)? How does it relate to `PATH`?

---

<div class="post-metadata">

**Author:** ![techraf](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@techraf](https://forum.ansible.com/u/techraf)\
**Post date:** [October 25, 2015, 10:56pm UTC](https://forum.ansible.com/t/ansible-inventory-option-with-a-trailing-comma/19606/2 "2015-10-25T22:56:02Z")

</div>

Well… According to [this post](https://groups.google.com/d/msg/ansible-project/RuntoPUvqHM/Br8ag1ZuKqgJ) it is a hack.

Still information is scarce. Is it intentional, a quick fix for the purpose of running against single host, or is it a bug, that got utilized this way…

---

<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:** [October 26, 2015, 1:53pm UTC](https://forum.ansible.com/t/ansible-inventory-option-with-a-trailing-comma/19606/3 "2015-10-26T13:53:09Z")

</div>

The , indicates its not a path but an 'adhoc list of hosts', this is  
missing from the man pages, which are sadly behind the rest of the  
docs
