capable.core221.include_fact
Load variables from a file and set them as facts
Reads variables from a YAML or JSON file on the controller.
Sets those variables as facts using M(ansible.builtin.set_fact).
The file must contain a non-empty dictionary at the top level.
File values are evaluated once when this task runs, using the current task variables.
Parameters
Section titled “Parameters”cacheable
Section titled “cacheable”Type: bool · Default: False
Whether to cache the facts using the fact cache.
Mirrors the cacheable option from M(ansible.builtin.set_fact).
file (required)
Section titled “file (required)”Type: path · Required: yes
Path to the variables file to load. Similar to M(ansible.builtin.include_vars), the path is resolved relative to the playbook and roles.
Examples
Section titled “Examples”- name: Load facts from a vars file capable.core221.include_fact: file: vars/app.yml cacheable: trueReturn Values
Section titled “Return Values”ansible_facts
Section titled “ansible_facts”Type: dict · Returned: success
Facts set from the file.
ansible_included_var_files
Section titled “ansible_included_var_files”Type: list · Returned: success
List of vars files that were loaded.
Authors
Section titled “Authors”- Kirill Satarin (@kksat)