host_int_map.j2 452 B

12345678910111213
  1. ---
  2. {% for host in groups[etcd_peers_group] %}
  3. {% set entry=hostvars[host] %}
  4. {{ entry.inventory_hostname }}:
  5. {% if 'etcd_interface' in entry %}
  6. etcd_interface: {{ entry.etcd_interface }}
  7. {% if entry.etcd_interface in entry.ansible_interfaces %}
  8. interface: {{ entry['ansible_' ~ entry.etcd_interface] | to_json }}
  9. {% endif %}
  10. {% else %}
  11. interface: {{ entry['ansible_' ~ entry.ansible_default_ipv4.interface] | to_json }}
  12. {% endif %}
  13. {% endfor %}