title: Excluding subset of hosts in Ansible inventory
body: <p>I have a set of hosts named <code>vm2-prod</code> through <code>vm14-prod</code>. These are grouped in the Ansible hosts inventory as <code>vmware_hosts</code>. I want to exclude a subset of hosts like this:</p>
  <pre><code>- name: testing play
    hosts: vmware_hosts:!vm[8-10]-prod
  </code></pre>
  <p>According to the Ansible docs, it seems this should exclude <code>vm7-prod</code> through <code>vm9-prod</code>. However, I get the &quot;could not match host pattern, ignoring vm[8-10]-prod&quot; like it's reading the literal host name &quot;vm[8-10]-prod&quot; rather than an array.</p>
  <p>I also tried <code>vm[8:10]-prod</code>, but it gives the same error.</p>
  <p>What is wrong?</p>