Search on AWS inventory and add to hosts

Hi all
I have come up with a search on AWS inventory. What I want to do is add the resulted instances to using add_host. This is how use ec2.py to find the instances:

ec2.py ‘tag_Name_basebox_myteksi_net:&tag_Provisioned_False’

What would the task for this look like?

It would look like this, simply using the add host module to create a new group based on that pattern.

  • hosts: tag_Name_basebox_myteksi_net:&tag_Provisioned_False
    tasks:
  • add_host: key=my_new_dynamic_group_alias

Note that this would only happen in memory, to do other things, you might wish to use the ec2_tag module to assign new tags as well.

Hope this helps and let me know if there are any questions!