Hi. I have the following inventory structure

master1 ansible_ssh_host=10.0.45.11
master2 ansible_ssh_host=10.0.45.12
master3 ansible_ssh_host=10.0.45.13
slave1 ansible_ssh_host=10.0.45.51
slave2 ansible_ssh_host=10.0.45.52
slave3 ansible_ssh_host=10.0.45.53

[master_servers]
master1
master2
master3

...

Now I need a URL that looks something like this 
*zk://10.0.45.11:2181,10.0.45.12:2181,10.0.45.13:2181/mesos*
For that reason I need a list of *ansible_ssh_host* variables for all 
servers in the group *master_servers*.

I ended up with this
[hostvars[groups['master_servers'][0]].ansible_ssh_host, 
hostvars[groups['master_servers'][1]].ansible_ssh_host, 
hostvars[groups['master_servers'][2]].ansible_ssh_host]

but this solution takes only three servers not all in the group

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b3c8e2fe-ec8c-4655-88eb-cc5813c08673%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to