network/roles/fabric/templates/peerlink.intf.j2

18 lines
702 B
Plaintext
Raw Permalink Normal View History

2023-12-18 10:22:14 +00:00
{% set peer_ip = hostvars[peer].interfaces
| selectattr('name', '==', 'lo')
| map(attribute='ip_addresses') | first
| selectattr('role') | selectattr('role.value', '==', 'loopback')
| map(attribute='address') | ipv4 | first | ipaddr('address') %}
{% set anycast_ip = interfaces
| selectattr('name', '==', 'lo')
| map(attribute='ip_addresses') | first
| selectattr('role') | selectattr('role.value', '==', 'anycast')
| map(attribute='address') | ipv4 | first | ipaddr('address') -%}
# Peer link to the other switch.
auto peerlink.4094
iface peerlink.4094
clagd-peer-ip linklocal
clagd-backup-ip {{ peer_ip }}
clagd-sys-mac {{ anycast_ip | cl_clag_sys_mac }}