Load variables from YAML files into the current execution context for use by subsequent tasks.
| Parameter | Description | Type | Required | Default |
|---|---|---|---|---|
| include_vars | Variable file path, must be .yaml or .yml |
string | Yes | - |
Paths can use template syntax, for example, loading different files based on architecture.
1. Load variable files conditionally
- name: load vars by architecture
include_vars: "{{ .os.architecture }}/var.yaml"