import_playbook can be used to import one playbook into another playbook. A command uses of this is to have a master parent playbook that performs plays from child playbooks, like this.
- import_playbook: child.yml
Or like this.
- name: first child playbook
import_playbook: child.yml
import_playbook cannot be run inside a task. For example, this would not work. include_tasks can be used to run a playbook within tasks.
- hosts: all
tasks:
import_playbook: child.yml