Generate number sequence for dynamic server inventory

12 views
Skip to first unread message

titlei...@gmail.com

unread,
Sep 1, 2016, 2:41:00 PM9/1/16
to Ansible Project
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
Reply all
Reply to author
Forward
0 new messages