include_vars Module

May 8, 2026 ยท View on GitHub

Load variables from YAML files into the current execution context for use by subsequent tasks.

Parameters

ParameterDescriptionTypeRequiredDefault
include_varsVariable file path, must be .yaml or .ymlstringYes-

Paths can use template syntax, for example, loading different files based on architecture.

Examples

1. Load variable files conditionally

- name: load vars by architecture
  include_vars: "{{ .os.architecture }}/var.yaml"