add route-reflector-client support; fix form_factor

master
Marek Isalski 5 years ago
parent 68d95a05ad
commit 603fbe1979

@ -54,7 +54,7 @@ interfaces {
} }
{% endif %} {% endif %}
} }
{% elif iface_data['form_factor']['label'] != 'Virtual' %} {% elif iface_data.get('form_factor',{}).get('label','') != 'Virtual' %}
ethernet {{ iface_name }} { 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 %}" 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'] %} {% for address in iface_data['addresses'] %}
@ -93,7 +93,7 @@ interfaces {
} }
{% endfor %} {% 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 %} {% endif %}{% endfor %}
{% if salt['pillar.get']('interfaces:'+iface_name+':ip') %} {% if salt['pillar.get']('interfaces:'+iface_name+':ip') %}
@ -233,6 +233,7 @@ protocols {
address-family { address-family {
{% if as_data['address-family'].get('ipv4-unicast',None) %} {% if as_data['address-family'].get('ipv4-unicast',None) %}
ipv4-unicast { ipv4-unicast {
{% if as_data['address-family']['ipv4-unicast'].get('route-reflector-client',False) %}route-reflector-client{% endif %}
redistribute { redistribute {
{% for redistribute, redist_data in as_data['address-family']['ipv4-unicast'].get('redistribute',{}).items() %} {% for redistribute, redist_data in as_data['address-family']['ipv4-unicast'].get('redistribute',{}).items() %}
{{ redistribute }} { {{ redistribute }} {
@ -249,6 +250,7 @@ protocols {
{% endif %} {% endif %}
{% if as_data['address-family'].get('ipv6-unicast',None) %} {% if as_data['address-family'].get('ipv6-unicast',None) %}
ipv6-unicast { ipv6-unicast {
{% if as_data['address-family']['ipv6-unicast'].get('route-reflector-client',False) %}route-reflector-client{% endif %}
redistribute { redistribute {
{% for redistribute, redist_data in as_data['address-family']['ipv6-unicast'].get('redistribute',{}).items() %} {% for redistribute, redist_data in as_data['address-family']['ipv6-unicast'].get('redistribute',{}).items() %}
{{ redistribute }} { {{ redistribute }} {

Loading…
Cancel
Save