Description
Hi,
This is more-or-less a review of PR #2416, with an eye towards what PR #2386 was intended to improve. Apologies for doing this after-the-fact.
In no particular order:
Nothing explicitly says that when you specify a directory in which to find inventory, that inventory is collected in a recursive breath-first manner from all sub-directories. Although this is implied by "Files will be read and loaded in alphabetically sorted order from the top directory down." , the reader has to pay attention, and do a certain amount of assuming, to realize that that means that sub-directories, and their sub-sub-directories, etc., are searched for inventory files. Something more explicit would be better.
Nothing explicitly says that host_vars
and group_vars
dirs are searched for only in the directory given to ansible as the top-level dir in which to search for inventory. This is almost implied by an example that starts with "If your inventory file at /etc/ansible/hosts ...". But not really because I can invoke ansible with
ansible-playbook -i /etc ...
and while the example will still use the same inventory files, the group_vars
and host_vars
dirs will not be used. (And yes, looking through all of /etc would be bad, but that's not the point.) The example implies that it matters where the inventory file is found, but this is not the case. In the end, it is left undocumented that, although inventory files are searched for in sub-directories, this is not the case for the host_vars and group_vars directories.
I am not a fan of "documentation by example". I believe that the text should be explicit about the behavior documented. Rather than just an example it would be best to have sentences that document behavior. So the example starting with "If your inventory file at /etc/ansible/hosts ..." should be supplemented with sentences that document behavior. The example can then clarify and illustrate the behavior. The reader should not have to guess at the behavior the example is supposed to illustrate.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status