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

382 views
Skip to first unread message

Govardhana M.K.

unread,
Dec 28, 2016, 10:53:30 AM12/28/16
to Ansible Project
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

matthew zeier

unread,
Jan 1, 2017, 9:59:04 PM1/1/17
to Ansible Project
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).
Reply all
Reply to author
Forward
0 new messages