Hi all,

Suppose I have two environments and in EC2 built with cloudformation and 
they are grouped or tagged as:

tag_aws_cloudformation_stack_name_example_d1
tag_aws_cloudformation_stack_name_example_d2

within each cloudformation group I will have servers, they are tagged as 
follows:

ec2:
Role=example_ldap

Ansible:
tag_ec2_Role=example_ldap

I use a limit on my ansible play for one of the grouped environments: 

-l tag_aws_cloudformation_stack_name_example_d2

When I run a play, and try to get the hosts of 'example_ldap':

hostvars[groups['tag_Role_example_ldap'][0]].ec2_tag_Name

I could receive either d1 or d2's example_ldap host.

Is there a way I can limit what I get back from the ec2 dynamic inventory 
or do I need to be more specific with my group names, so example_ldap would 
become example_ldap_d1? Or am I missing out on a better way to achieve this?

Thanks


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d56964f4-7660-4bfd-ac2f-65b72c1b0b93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to