I'm working on a system that can run one playbook to launch some number of EC2 instances for any number of purposes. For example, a development, it might lauch & provision 2 web servers and 1 search server. In production, it might be even more specific and launch 2 api servers, 2 dashboard servers, 1 general web server and 1 search server. It's trying to be pretty flexible like that.
When launched, the instances are tagged in various ways. For example: ManagedBy: Ansible Environment: dev|stg|prd Roles: web,api,dashboard,corp,search Now I need to write playbooks that execute against existing servers and I'd like to be able to run something like this: $ ansible-playbook -i development/ec2.py dosomething.yml --ask-vault-pass And then, in my playbook, identify my hosts based on tags. In the simplest case, set hosts: <all servers whose ManagedBy tag is 'Ansible" AND whose Environment tag is "development">. Is it possible to set the hosts value based on multiple tags? In a slightly different example, I may need to execute a set of roles/tasks only against a server whose role includes "api". This would mean parsing the "Roles" tag that is a comma delimited list of the projects installed on a given instance. Am I asking dynamic inventory to do too much? Is this possible in this or any other reasonable way? 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 ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/8f7253a6-c293-431d-aa3e-64302cf9a72a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.