capable.core221.set_vars
Assign inline variables without changing data trust
Keeps templated inline variables in memory, preserving their Ansible data tags and native types.
Supports namespace and hash-merging options similar to ansible.builtin.include_vars.
On ansible-core 2.21 and later, uses the public variable-layer API for builtin include_vars precedence and nonpersistent variable storage.
Parameters
Section titled “Parameters”Type: int
Accepted for compatibility; has no effect on inline variables.
extensions
Section titled “extensions”Type: list
Accepted for compatibility; has no effect on inline variables.
files_matching
Section titled “files_matching”Type: str
Accepted for compatibility; has no effect on inline variables.
hash_behaviour
Section titled “hash_behaviour”Type: str · Choices: merge | replace
Merge strategy for hash variables, as in include_vars.
When omitted, uses the controller’s configured hash behaviour.
ignore_files
Section titled “ignore_files”Type: list
Accepted for compatibility; has no effect on inline variables.
ignore_unknown_extensions
Section titled “ignore_unknown_extensions”Type: bool
Accepted for compatibility; has no effect on inline variables.
Type: str
Store loaded variables under this key (namespace), as in include_vars.
Type: dict
Variables to set (mapping).
When omitted, any task arguments that are not include_vars options are treated as variables to set (set_fact-style shorthand).
Examples
Section titled “Examples”- name: Set vars (set_fact-style shorthand) capable.core221.set_vars: answer: 42 nested: hello: world
- name: Set vars with include_vars namespace capable.core221.set_vars: name: my_namespace vars: answer: 42Return Values
Section titled “Return Values”ansible_facts
Section titled “ansible_facts”Type: dict · Returned: when successful
Variables set by the task (same shape as include_vars result).
Authors
Section titled “Authors”- Kirill Satarin (@kksat)