fabric: get mgmt gateway from custom field on prefix
Mainly so we can add IPv6 addresses to mgmt interfaces.
This commit is contained in:
		
							parent
							
								
									bc93f26a21
								
							
						
					
					
						commit
						9c35f0fa25
					
				
					 1 changed files with 6 additions and 4 deletions
				
			
		|  | @ -14,11 +14,13 @@ iface {{ iface.name }} | ||||||
|     vrf mgmt |     vrf mgmt | ||||||
|     ip-forward off |     ip-forward off | ||||||
|     ip6-forward off |     ip6-forward off | ||||||
| {% for ip in iface.ip_addresses | rejectattr('address', 'match', '^fe80::.*/64$' ) %} | {% for ip in iface.ip_addresses %} | ||||||
|     address {{ ip.address }} |     address {{ ip.address }} | ||||||
| {% endfor %} | {% set subnet = ip.address | ipaddr('subnet') %} | ||||||
| {% if iface.custom_fields.gateway %} | {% set prefix = prefixes | selectattr('prefix', '==', subnet) | first %} | ||||||
|     gateway {{ iface.custom_fields.gateway.address | ipaddr('address') }} | {% if prefix.custom_fields.gateway %} | ||||||
|  |     gateway {{ prefix.custom_fields.gateway.address | ipaddr('address') }} | ||||||
| {% endif %} | {% endif %} | ||||||
|  | {% endfor %} | ||||||
| 
 | 
 | ||||||
| {% endfor %} | {% endfor %} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue