techraf
October 25, 2015, 12:53am
1
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
October 25, 2015, 10:56pm
2
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
(Brian Coca)
October 26, 2015, 1:53pm
3
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