Skip to content

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.

Type: bool · Default: False

Whether to cache the facts using the fact cache. Mirrors the cacheable option from M(ansible.builtin.set_fact).


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.


- name: Load facts from a vars file
capable.core221.include_fact:
file: vars/app.yml
cacheable: true

Type: dict · Returned: success

Facts set from the file.


Type: list · Returned: success

List of vars files that were loaded.


  • Kirill Satarin (@kksat)