ansible --inventory option with a trailing comma

287 views
Skip to first unread message

techraf

unread,
Oct 24, 2015, 8:53:32 PM10/24/15
to Ansible Project
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`?

techraf

unread,
Oct 25, 2015, 6:56:02 PM10/25/15
to Ansible Project
Well... According to this post 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...

Brian Coca

unread,
Oct 26, 2015, 9:53:14 AM10/26/15
to Ansible Project
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

--
Brian Coca
Reply all
Reply to author
Forward
0 new messages