Inventory: IP's of all group members except self

31 views
Skip to first unread message

Dirk Louwers

unread,
Nov 7, 2014, 9:40:26 AM11/7/14
to ansible...@googlegroups.com
Hi,

I just started out experimenting with roles from Ansible Galaxy. I came across a role that required the hosts of all other instances of this server. Since I keep all of them in the same group I was wondering how I can pass all of a groups IP's to a role except for the machine's own. Please let me know if this question isn't clear.

Best,

Dirk

Hagai Kariti

unread,
Nov 10, 2014, 3:14:16 AM11/10/14
to ansible...@googlegroups.com
If the inventory hostnames are enough, you can do this:

{{ groups.SOME_GROUP | difference([inventory_hostname]) | list }}
Reply all
Reply to author
Forward
0 new messages