inventory variable range

I am not quite sure how to do this. E.g.

I have a group of hosts

www[100:150]

and I need to assign their hostnames:

ansible_ssh_host = www[100:150].example.com

obviously I can’t do the above (I did try though). I assume there needs to be some abstraction and some sort of yaml magic happening here.

You can’t do this and need to set the variable on every host.