Paths relative to tasks

I’ve been making quite liberal use of tasks to encourage re use. These tasks then get used in variety of playbooks. I’ve had to take great care in keeping all playbooks at the same level so the relative pathing works when using tasks across playbooks in different folders. This is ok for playbooks in a single project but is problematic where tasks & playbooks are in seperate repositories that may not follow the same convention. It would be very useful to be able to specific paths relative to tasks as well as playbooks. Below is an example, incase I’m getting all mixed up:

some-other-ansible/my-quick-playbook.yml
my-ansible/playbooks/products/sudo/
→ tasks/
→ grant_sudo.yml
→ templates/
→ sudo_name_target.j2

In this case, grant_sudo.yml is wanted by my-quick-playbook.yml, but because the template is needed the relative pathing doesn’t work. sudo doesn’t really warrant a whole playbook in its own right. my-quick-playbook.yml also references other playbooks and tasks.

Or should I just be passing complex variables around? With a bit of work I might to able to form an array of hashes (maybe?) and pass that to a sudo playbook but it seems like over complication.

Thanks,

Matt