ec2 tag instance filters 'AND' condition implementation in Ansible-Tower

I would like to filter the dynamically discovered instances with ec2.py based on ‘AND’ condition of ec2 tags with instance filters.

only able to achieve OR condition with the syntax as below:

tag:tagkey1=tagvalue1,tag:tagkey2=tagvalue2

Need to filter the output with AND condition

I think you’re asking how to do this with a --limit?

I think you’re looking for http://docs.ansible.com/ansible/intro_patterns.html.

Here’s a syntax I use:

ansible-playbook -i ec2.py -l tag_cluster_database:tag_cluster_web common.yml

The “:” does an OR between those two tags (or inventory groups).