We have one role called shared_tasks
that contains almost nothing but various tasks files dedicated to specific purposes like this. It doesn’t even have a tasks/main.yml
. To use it, we invoke include_role
with the tasks_from
parameter indicating which tasks file to use, and we add any variables as needed in a vars
section.
That sounds to me like exactly the problem w/ solution you described.