servers/roles/ceph/templates/hosts.j2
Timotej Lazar 5038411af3 Add ceph role
Just prepares the servers, all management is then done through cephadm.
2023-11-20 13:04:11 +01:00

12 lines
572 B
Django/Jinja

127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
{% set my_cluster = query('netbox.netbox.nb_lookup', 'clusters', raw_data=true, api_filter='name='~cluster) | first %}
{% for host in query('netbox.netbox.nb_lookup', 'devices', raw_data=true, api_filter='cluster_id='~my_cluster.id) | map(attribute='name') %}
{% for address in (hostvars[host].interfaces | selectattr('name', 'equalto', 'lo') | map(attribute='ip_addresses') | first) %}
{{ address.address | ipaddr('address') }} {{ host }}
{% endfor %}
{% endfor %}