I\'m writing an Ansible template that needs to produce a list of ip\'s in a host group, excluding the current hosts IP. I\'ve searched around online an
There is difference filter for that:
difference
- debug: var=item with_items: "{{ groups['my_group'] | difference([inventory_hostname]) }}"
This will give you all items hosts from my_group without current host.
my_group