I think the way you'd want to do this is to provision your machines, then use the add_hosts (or the group_by) module to dynamically create groups of servers based on variable data . Then, create playbooks that target each group. So, for example, you create a series of web servers, add them to a group called
web with
add_host or
group_by, then target the group
'web' in a playbook using include statements. If there are hosts in the web group, the playbook will run. For included playbooks that have no hosts for groups that are targeted, the playbook will be skipped.
If you look at that play, the second task is adding the server created in the first task to a group called "dockergroup". I can then later do work on that group by creating a play that targets "hosts: dockergroup".
Hope that helps.