Including tasks from another role

35 views
Skip to first unread message

Akos Vandra

unread,
Aug 20, 2014, 3:21:28 AM8/20/14
to ansible-project
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

Michael DeHaan

unread,
Aug 20, 2014, 9:06:38 AM8/20/14
to ansible...@googlegroups.com
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





--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAHHcNoc-aKWcgDgR05wwBxKKA2G8byj_7f1YzwD0ouOPuwDMcQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Michael DeHaan

unread,
Aug 20, 2014, 9:06:53 AM8/20/14
to ansible...@googlegroups.com
Forgot my quotes :)

- include: "{{ playbook_dir }}/roles/foo/tasks/bar.yml"
Reply all
Reply to author
Forward
0 new messages