Short Answer: You do programming here. Consider Programming Standards (cleancode) like "package by feature" and build role which are reusable and express the reason of the role.e.g.
roles: - role: jdk - role: tomcat (contains tasks with 'install tomcat', 'configure tomcat' ) (requires jdk) - role: the_wepapp (requires tomcat)
Futhermore: The underlying role e.g. the jdk should never know about the tomcat role etc...