FreeKB - include_tasks module
Ansible - include_tasks module

Let's say you've a two playbooks, foo.yml and bar.yml. The include_tasks module can be used to include tasks from one playbook in another. For example, if foo.yml contains the following, then the tasks in foo.yml and bar.yml will be played.

- include_tasks: bar.yml

 

include_tasks must be used within tasks, like this.

- hosts: all
  tasks:
    - include_tasks: foo.yml

 

import_playbook cannot be run inside a task meaning that you would use import_playbook to run a play outside of tasks.



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter 6bd62 in the box below so that we can be sure you are a human.




Comments