ansible.builtin.host_group_vars vars – In charge of loading group_vars and host_vars
Note
This vars plugin is part of ansible-core
and included in all Ansible installations. In most cases, you can use the short plugin name host_group_vars
. However, we recommend you use the Fully Qualified Collection Name (FQCN) ansible.builtin.host_group_vars
for easy linking to the plugin documentation and to avoid conflicting with other collections that may have the same vars plugin name.
Synopsis
- Loads YAML vars into corresponding groups/hosts in group_vars/ and host_vars/ directories.
- Files are restricted by extension to one of .yaml, .json, .yml or no extension.
- Hidden (starting with ‘.’) and backup (ending with ‘~’) files and directories are ignored.
- Only applies to inventory sources that are existing paths.
- Starting in 2.10, this plugin requires enabling and is enabled by default.
Requirements
The below requirements are needed on the local controller node that executes this vars.
- Enabled in configuration
Parameters
Parameter | Comments |
---|---|
_valid_extensions list / elements=string | Check all of these extensions when looking for ‘variable’ files which should be YAML or JSON or vaulted versions of these. This affects vars_files, include_vars, inventory and vars plugins among others. Default: Configuration:
|
stage string added in ansible-base 2.10 | Control when this vars plugin may be executed. Setting this option to Setting this option to Setting this option to If this option is omitted, the global Choices:
Configuration:
|
Hint
Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.
Collection links
© 2012–2018 Michael DeHaan
© 2018–2024 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/host_group_vars_vars.html