# Ranges of hosts in the inventory (INI) file

**URL:** <https://forum.ansible.com/t/ranges-of-hosts-in-the-inventory-ini-file/11718>\
**Category:** Ansible Project\
**Created:** [July 25, 2012, 1:57am UTC](https://forum.ansible.com/t/ranges-of-hosts-in-the-inventory-ini-file/11718 "2012-07-25T01:57:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [July 25, 2012, 1:57am UTC](https://forum.ansible.com/t/ranges-of-hosts-in-the-inventory-ini-file/11718/1 "2012-07-25T01:57:20Z")

</div>

I've just pushed a very nice patch from Chin Fang that allows host ranges in the inventory file.

It looks like this:

[webservers]  
foo.example.com  
www[001:050].example.com

If you put leading zeros in there, it will keep the leading zeros, if you don't want them, don't include any leading zeros. I modified the patch slightly so the range is inclusive, not exclusive. (www050.example.com will be in the list in the above example)

I'll include this in the docs once 0.6 releases.

--Michael
