# ansible \<host-pattern\> expansion is not working -\> ansible servers\[:24\] -vv  -i inventory\_file  -m shell -a "echo yes"

**URL:** <https://forum.ansible.com/t/ansible-host-pattern-expansion-is-not-working-ansible-servers-24-vv-i-inventory-file-m-shell-a-echo-yes/20326>\
**Category:** Ansible Project\
**Created:** [January 23, 2016, 12:39am UTC](https://forum.ansible.com/t/ansible-host-pattern-expansion-is-not-working-ansible-servers-24-vv-i-inventory-file-m-shell-a-echo-yes/20326 "2016-01-23T00:39:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![v11](https://avatars.discourse-cdn.com/v4/letter/v/e47c2d/32.png) [@v11](https://forum.ansible.com/u/v11)\
**Post date:** [January 23, 2016, 12:39am UTC](https://forum.ansible.com/t/ansible-host-pattern-expansion-is-not-working-ansible-servers-24-vv-i-inventory-file-m-shell-a-echo-yes/20326/1 "2016-01-23T00:39:33Z")

</div>

Hi,

ansible expansion is not working. Is this because it has to do double expansion in inventory? Could it possibly be a bug? I am doing something wrong?

ansible --version  
ansible 1.9.2  
configured module search path = None

invetory\_file:  
[servers]  
db-[0001:0048].ansbile.com

The following does not work:  
$ ansible servers[:24] -vv -i inventory\_file -m shell -a “echo yes”  
No hosts matched

Thanks
