include_tasks
Collection: builtin
Full Name: parallax.builtin.include_tasks
Aliases: ansible.builtin.include_tasks, include_tasks
Synopsis
Dynamically include a task file at run time
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| free_form | string | yes | The name of the imported file is specified directly without any other option | |
| file | string | The name of the imported file | ||
| apply | map | Accepts a hash of task keywords (e.g. tags, become) that will be applied to the tasks within the include |
Example
- name: Include the per-platform tasks
include_tasks:
file: "tasks/{{ ansible_os_family }}.yml"