Accessing server inventory list while deploying to clients
19 views
Skip to first unread message
ajres
unread,
Apr 15, 2015, 9:18:58 AM4/15/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
I have a playbook that configures multiple client machines.
Each client needs to be configured with a unique server IP address from the servers in a cluster.
The mapping from client to server is one-to-one, all the hosts are running in ec2, and the inventory is dynamic.
Is there a way that I can get the list of servers from the inventory as a list variable, and iterate over the the list as ansible configures each client?
Brian Coca
unread,
Apr 15, 2015, 10:04:38 AM4/15/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
the groups variable is a dictionary with the groups in which the keys
are the list of servers that are part of it, so for example
groups['all'] has a list of all the servers, you just need groups[<my
server group>]