title: Filtering multiple tags in Ansible dynamic inventory
body: <p>I think I've seen an answer to this <em>somewhere</em>, but I can't seem to find it now.  I'm creating a dynamic <code>development</code> inventory file for my EC2 instances. I'd like to group all instances tagged with <code>Stack=Development</code>. Moreover, I'd like to specifically identify the development API servers. Those would not only have the <code>Stack=Development</code> tag, but also the <code>API=Yes</code> tag.</p>
  
  <p>My basic setup uses inventory folders:</p>
  
  <pre><code>&lt;root&gt;/development
    ├── base
    ├── ec2.ini
    └── ec2.py
  </code></pre>
  
  <p>In my <code>base</code> file, I'd like to have something like this:</p>
  
  <pre><code>[servers]
  tag_Stack_Development
  
  [apiservers]
  tag_Stack_Development &amp;&amp; tag_API_Yes
  </code></pre>
  
  <p>Then I'd be able to run this to ping all of my development api servers:</p>
  
  <pre><code>ansible -i development -u myuser apiservers -m ping
  </code></pre>
  
  <p>Can something like that be done? I know the syntax isn't right, but hopefully the intent is reasonably clear? I can't imagine I'm the only one who's ever needed to filter on multiple tags, but I haven't been able to find anything that gets me where I'm trying to go.</p>