17 lines
		
	
	
	
		
			702 B
		
	
	
	
		
			Django/Jinja
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
	
		
			702 B
		
	
	
	
		
			Django/Jinja
		
	
	
	
	
	
| {% 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 }}
 |