I have a jinja2 template designed to print out the IP addresses of ec2 instances (tagged region: au) :
{% for host in groups['tag_region_au'] %}
My problem is I can't for the life of me work out how to include only hosts that exist in one group and NOT another (however each host may be in two or more groups), for example in python the following works:
( (a in list) and ( a not in list2) )
However the following does not:
{% for (host in groups['tag_region_au']) and (host not in groups['tag_state_live']) %}
Any idea how I can include only hosts that exist in one group and that do not exist in the another group?