Generate number sequence for dynamic server inventory

Hello,

I’m currently building some servers in AWS. A set of servers will need a sequence of keys generated for each server like so, with a template that get’s pushed out.

server 1

9011
9012
9013

server 2

9021
9022
9023

server 3

9031
9032
9033

If my inventory is dynamic, what is a good Ansible-ish way of handling this? I know I can do a “with_sequence: start=1 end=3”, but that same ‘with’ statement does the same thing on all 3 servers. I normally would use a host_var, but since the inventory is dynamic, I can’t do that. At least I don’t think I can.

Any ideas?

Thanks,
Jay