Including tasks from another role

Hello!

Is there any way to include tasks from another role other than:

- include: ../../common/tasks/rake_db_migrate.yml project_dir={{deployed_to}}

I would like to see that either

- include: common/tasks/rake_db_migrate.yml project_dir={{deployed_to}}
or
- include: /common/tasks/rake_db_migrate.yml project_dir={{deployed_to}}
or
- include: /roles/common/tasks/rake_db_migrate.yml project_dir={{deployed_to}}

works

Regards,
  Akos Vandra

You definitely don’t want to specify a path off of “/” (root).

It sounds like you are asking to not have to use relative paths.

You can do this.

  • include: {{ playbook_dir }}/roles/foo/tasks/bar.yml

Forgot my quotes :slight_smile:

  • include: “{{ playbook_dir }}/roles/foo/tasks/bar.yml”