I think I saw the answer to this somewhere, but now I can not find it. I am creating a dynamic development inventory file for my EC2 instances. I would like to group all instances with Stack=Development tags. Moreover, I would like to specifically define the development API servers. They will have not only the Stack=Development tag, but also the API=Yes tag.
My main setup uses inventory folders:
<root>/development βββ base βββ ec2.ini βββ ec2.py
In my base file, I would like to have something like this:
[servers] tag_Stack_Development [apiservers] tag_Stack_Development && tag_API_Yes
Then I could run this to ping all my development api servers:
ansible -i development -u myuser apiservers -m ping
Is there anything you can do? I know the syntax is wrong, but hopefully the intention is clear enough? I canβt imagine that Iβm the only one who ever needed to filter by several tags, but I couldnβt find anything that takes me to where I am trying to go.
ansible
Rob wilkerson
source share