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