Include playbook from another role

19 views
Skip to first unread message

anatoly techtonik

unread,
Oct 16, 2014, 2:50:19 AM10/16/14
to ansible...@googlegroups.com
I just want to confirm that there is no way to include playbook from a role different than current one without resorting to absolute paths. I want this:

+ roles/
   + app-core/
      + tasks/
         main.yml
         permissions.yml
   + app2-core/
      + tasks/
         main.yml

And in roles/app2-core/tasks/main.yml have this one to work:

- include: roles/app-core/tasks/permissions.yml

This doesn't work currently. Moving permissions to a separate role looks ugly, because setting permissions is a just common task - not a role - and I'd like to avoid code duplication. It looks like any role playbooks except main.yml are pretty useless, because what is the point in splitting main.yml to parts if the code can not be reused anywhere else?
Reply all
Reply to author
Forward
0 new messages