Sure thing. So most of the cloud provisioning modules in Ansible, ok, all of them, are generally executed in a block that looks like this:
- hosts: localhost
connection: local
tasks:
- ....
- add_host: ... # add the hosts temporarily to inventory until the inventory script caching resets and picks them up, or alternatively, invalidate the cache...
- hosts: somegroup
tasks:
- ...
Which means to say it doesn't need the hosts defined in inventory before it builds them. it's something that runs on the local machine, talks to the cloud API, and makes machines exist.Thus, also with the cloud formation module, yes, I'd probably recommend passing in a parameter.
It doesn't make sense to put these in inventory variables to me, but passing them in with "-e / --extra-vars" might be appropriate, or if you had seperate playbooks that used common includes you could perhaps even use a role or task parameter.
--Michael