app namespacing in ansible

Hi
Hopefully this is not too much of a FAQ. I was looking for a pattern for app instance deployment in ansible:

  1. A user wants to deploy an instance of an app that runs across multiple VMs - a Hadoop cluster is a canonical example.
  2. The user specifies the hardware shape of the VMs externally
  3. The VMs for the instance of the app (hadoop cluster instance) can be spun up using vagrant - using a specific vagrant provider.
  4. This clearly appears like a case where I’ll need a dynamic inventory of some sort since the set of VMs is app-instance specific. However, in this case, the dynamic inventory will need to take input arguments outside of --host and --list so that the right inventory can be presented for the specific app instance. Is this kosher?

In general since there may be multiple simultaneous app deployments going on at the same time, and we don’t want inventories to get mixed up, what is the right Ansible pattern to use for this? I sincerely hope that I don’t have to create a directory per app instance on the Ansible server…

thanks

V