- name: find another host to join to form a cluster (e.g. Consul)
set_fact:
host_to_join: >
{{
groups['my_group'] | difference([inventory_hostname])
| list
| random
| find_in(hostvars)
| get_key('ec2_private_ip_address')
}}