#!/bin/sh

echo
echo "Public IP:   {{ ansible_host }}"
echo "Private IP:  {{ private_ip }}"
echo "Role:        {{ hostvars[inventory_hostname]['tags.Role'] }}"
echo "Hostname:    {{ hostname }}"
{% if keystore_address is defined %}echo "Eth-Address: 0x{{ keystore_address }}"{% endif %}

echo

echo "Available nodes:"
{% for name, group in display_groups.items()|sort %}
    echo "{{ name }}:"
    {% for item in groups[group]|sort %}
        echo "  - {{ hostvars[item]['hostname'] }} - {{ hostvars[item]['private_ip'] }}"
    {% endfor %}
    echo
{% endfor %}
