-
Notifications
You must be signed in to change notification settings - Fork 572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doc interplay between host_vars and group_vars dirs and inventory dirs #2386
base: devel
Are you sure you want to change the base?
Conversation
Thanks for your Ansible docs contribution! We talk about Ansible documentation on Matrix at #docs:ansible.im if you ever want to join us and chat about the docs! We meet on Matrix every Tuesday. See the Ansible calendar for meeting details. We welcome additions to our weekly agenda items too. You can add the |
inventory directory, but sub-directories are not searched for | ||
``host_vars`` or ``group_vars`` :ref:`directories | ||
<splitting_out_vars>`. Sub-directories with these names are ignored. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is partially incorrect and due to not distinguishing what inventory sources are from what vars plugins provide.
All vars plugins (host_group_vars vars plugin governs the inclusion of host_vars/group_vars dirs) use the 'inventory source' as a base, when that is a directory the multiple files/subdirs do not count as independent inventory sources, just the original directory does.
Those directories (and vars_plugins
and others from configuration INVENTORY_IGNORE_PATTERNS
and INVENTORY_IGNORE_EXTS
) are ignored if present, if not they would not have the same function you seem to expect. They would be processed at as part of an inventory source and they are probed as containing inventory files, but not vars files, which would end up either with warnings, errors or worse, creating unexpected hosts and groups depending on enabled inventory plugins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your review. I've pushed a patch in response.
The new docs do not include mention of INVENTORY_IGNORE_PATTERS, etc. That seems overkill here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added links to the ignore config settings, just to be through. Hopefully this is not confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found so many things that needed updating in this page that i ended up creating my own PR #2416
The concept with this PR is to focus on what happens
when a directory is specified for inventory.
|
This is by observation of behavior, not by examination of code.