Hosts with subnets ?

May be it's useful to support kind of notations in the hosts file
too ?

[group1]
10.2.1.*

[group2]
10.2.1.41/24

[group3]
10.2.1.1-10.2.1.5

Ranges in the host file are supported

[group1]
www.example-[001-100].com

Would generate hosts www.example-001.com through www.example-100.com

You can basically do this to emulate what you need with respect to subnets, but it's also generic so it's not just confined
to IP addresses.

I noticed this is not on the inventory docs page yet, so I'll make a note to get that in there.

--Michael

FWIW, it occurs to me there are reasons we shouldn't allow subnet entry.

Namely, it assumes all hosts in your subnet are taken and should be part of the same group. This may mean managing machines as if they were all the same, or trying to talk to a lot of hosts that aren't there.

If you're really on a static IP setup where you have a lot of homogenous hosts, code-generating your interface file might make sense, or even using the external inventory script feature to maintain your database differently.

Thoughts?

(Also note, www-[000-100].example.com makes a much more sensible example than the one below, typed that kind of fast)