ansible.builtin.host_group_vars (v2.16.5) — vars

In charge of loading group_vars and host_vars

| "added in version" 2.4 of ansible.builtin"

Authors: unknown

Install Ansible via pip

Install with pip install ansible-core==2.16.5

Description

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

Inputs

    
stage:
    choices:
    - all
    - task
    - inventory
    description:
    - Control when this vars plugin may be executed.
    - Setting this option to V(all) will run the vars plugin after importing inventory
      and whenever it is demanded by a task.
    - Setting this option to V(task) will only run the vars plugin whenever it is demanded
      by a task.
    - Setting this option to V(inventory) will only run the vars plugin after parsing
      inventory.
    - If this option is omitted, the global C(RUN_VARS_PLUGINS) configuration is used
      to determine when to execute the vars plugin.
    env:
    - name: ANSIBLE_VARS_PLUGIN_STAGE
    ini:
    - key: stage
      section: vars_host_group_vars
    type: str
    version_added: '2.10'
    version_added_collection: ansible.builtin

_valid_extensions:
    default:
    - .yml
    - .yaml
    - .json
    description:
    - 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.
    elements: string
    env:
    - name: ANSIBLE_YAML_FILENAME_EXT
    ini:
    - key: yaml_valid_extensions
      section: defaults
    type: list