Getting AWS inventory dynamically after cloudformation

Hi! currently I’m working on a playbook that creates an AWS cloudformation stack, then gets the ips of the created instances and run some commands on them.

I have this project structure:

`

  • main.yml
  • create_cloudformation_stack.yml
  • post_cfdeploy_tasks.yml
  • roles/
  • … (some private developed roles to get aws credentials, they work ok)
  • group_vars/
  • tag_someName_someKey.yml

`

main.yml looks like this:

`