From 603fbe19796cd4e045b567b2105fab5178c443d6 Mon Sep 17 00:00:00 2001 From: Marek Isalski Date: Thu, 20 Feb 2020 23:12:34 +0000 Subject: [PATCH] add route-reflector-client support; fix form_factor --- vyos.conf.j2 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vyos.conf.j2 b/vyos.conf.j2 index a317091..b064fd9 100644 --- a/vyos.conf.j2 +++ b/vyos.conf.j2 @@ -54,7 +54,7 @@ interfaces { } {% endif %} } -{% elif iface_data['form_factor']['label'] != 'Virtual' %} +{% elif iface_data.get('form_factor',{}).get('label','') != 'Virtual' %} ethernet {{ iface_name }} { description "{{ iface_data['description'].replace('"','\\"') or "-" }}{% if iface_data['connected_endpoint'] and iface_data['connected_endpoint']['connection_status']['value'] %} ({% if iface_data['connected_endpoint']['device'] %}{{ iface_data['connected_endpoint']['name'] }} @ {{ iface_data['connected_endpoint']['device']['display_name'] }}{% endif %}){% endif %}" {% for address in iface_data['addresses'] %} @@ -93,7 +93,7 @@ interfaces { } {% endfor %} - {% for subiface_name, subiface_data in pillar['netbox']['interfaces'].items() %}{% if subiface_data['form_factor']['label'] == 'Virtual' and subiface_name.startswith( iface_name + "." ) %} + {% for subiface_name, subiface_data in pillar['netbox']['interfaces'].items() %}{% if subiface_data.get('form_factor',{}).get('label','') == 'Virtual' and subiface_name.startswith( iface_name + "." ) %} {% endif %}{% endfor %} {% if salt['pillar.get']('interfaces:'+iface_name+':ip') %} @@ -233,6 +233,7 @@ protocols { address-family { {% if as_data['address-family'].get('ipv4-unicast',None) %} ipv4-unicast { + {% if as_data['address-family']['ipv4-unicast'].get('route-reflector-client',False) %}route-reflector-client{% endif %} redistribute { {% for redistribute, redist_data in as_data['address-family']['ipv4-unicast'].get('redistribute',{}).items() %} {{ redistribute }} { @@ -249,6 +250,7 @@ protocols { {% endif %} {% if as_data['address-family'].get('ipv6-unicast',None) %} ipv6-unicast { + {% if as_data['address-family']['ipv6-unicast'].get('route-reflector-client',False) %}route-reflector-client{% endif %} redistribute { {% for redistribute, redist_data in as_data['address-family']['ipv6-unicast'].get('redistribute',{}).items() %} {{ redistribute }} {