Updated template to new datastructure from finder-infra-crt
This commit is contained in:
@@ -31,9 +31,10 @@ set services infra-crt {{device}} service-policy
|
|||||||
|
|
||||||
{# Aggregate-interface declaration - protocol declaration for AEs is same as standard core-interfaces #}
|
{# Aggregate-interface declaration - protocol declaration for AEs is same as standard core-interfaces #}
|
||||||
{%- for key,aggregate_interface in interfaces["aggregate-interface"].items() %}
|
{%- for key,aggregate_interface in interfaces["aggregate-interface"].items() %}
|
||||||
|
{%- if aggregate_interface["disabled"] == False %}
|
||||||
{%- set ae_num = key | replace('ae', '') %}
|
{%- set ae_num = key | replace('ae', '') %}
|
||||||
{%- for key,aggregate_unit in aggregate_interface["units"].items() %}
|
{%- for key,aggregate_unit in aggregate_interface["units"].items() %}
|
||||||
{%- set protocol_int_name = aggregate_interface["name"] ~ '.' ~ aggregate_unit["name"] %}
|
{%- if aggregate_unit["disabled"] == False %}
|
||||||
{%- if aggregate_interface["mtu"] is not none %}
|
{%- if aggregate_interface["mtu"] is not none %}
|
||||||
set services infra-crt {{device}} interface aggregate-interface {{ae_num}} {{aggregate_unit["name"]}} mtu {{aggregate_interface["mtu"]}}
|
set services infra-crt {{device}} interface aggregate-interface {{ae_num}} {{aggregate_unit["name"]}} mtu {{aggregate_interface["mtu"]}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
@@ -51,54 +52,53 @@ set services infra-crt {{device}} interface aggregate-interface {{ae_num}} {{agg
|
|||||||
{%- endif %}
|
{%- endif %}
|
||||||
{#- Find Protocols for AE #}
|
{#- Find Protocols for AE #}
|
||||||
{#- ISIS#}
|
{#- ISIS#}
|
||||||
{%- if protocol_int_name in isis["interface"] %}
|
{%- if aggregate_unit["isis-passive"] == True %}
|
||||||
{%- if isis["interface"][protocol_int_name]["passive"] == True %}
|
|
||||||
set services infra-crt {{device}} isis passive-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}}
|
set services infra-crt {{device}} isis passive-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
set services infra-crt {{device}} isis core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} metric {{isis["interface"][protocol_int_name]["metric"]}}
|
set services infra-crt {{device}} isis core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} metric {{aggregate_unit["isis-l2-metric"]}}
|
||||||
{%- if isis["interface"][protocol_int_name]["enable-bfd"] == True %}
|
{%- if aggregate_unit["isis-inet-enable-bfd"] == True %}
|
||||||
set services infra-crt {{device}} isis core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} enable-bfd true
|
set services infra-crt {{device}} isis core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} enable-bfd true
|
||||||
set services infra-crt {{device}} isis core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} bfd-min-interval {{isis["interface"][protocol_int_name]["bfd-interval"]}}
|
set services infra-crt {{device}} isis core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} bfd-min-interval {{aggregate_unit["isis-inet-bfd-interval"]}}
|
||||||
set services infra-crt {{device}} isis core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} bfd-multiplier {{isis["interface"][protocol_int_name]["bfd-multiplier"]}}
|
set services infra-crt {{device}} isis core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} bfd-multiplier {{aggregate_unit["isis-inet-bfd-multiplier"]}}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
set services infra-crt {{device}} isis core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} enable-bfd false
|
set services infra-crt {{device}} isis core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} enable-bfd false
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endif %}
|
|
||||||
{#- LDP #}
|
{#- LDP #}
|
||||||
{%- if protocol_int_name in ldp["interface"] %}
|
{%- if aggregate_unit["ldp"] == True %}
|
||||||
set services infra-crt {{device}} ldp core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}}
|
set services infra-crt {{device}} ldp core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{#- MPLS-TE #}
|
{#- MPLS-TE #}
|
||||||
{%- if protocol_int_name in mpls_te["interface"] %}
|
{%- if aggregate_unit["mpls"] == True %}
|
||||||
{%- if mpls_te["interface"][protocol_int_name]["mpls-te-att-names"] is not none %}
|
{%- if aggregate_unit["mpls-te-att-names"] is not none %}
|
||||||
set services infra-crt {{device}} mpls-te core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} mpls-te-att-names {{mpls_te["interface"][protocol_int_name]["mpls-te-att-names"]}}
|
set services infra-crt {{device}} mpls-te core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} mpls-te-att-names {{aggregate_unit["mpls-te-att-names"]}}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
set services infra-crt {{device}} mpls-te core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}}
|
set services infra-crt {{device}} mpls-te core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{#- MPLS-TE-FRR #}
|
{#- MPLS-TE-FRR #}
|
||||||
{%- if protocol_int_name in mpls_te_frr["interface"] %}
|
{%- if aggregate_unit["mpls-te-frr-backup-bandwidth"] is not none %}
|
||||||
set services infra-crt {{device}} mpls-te-frr junos-core-interface {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} backup-bandwidth {{mpls_te_frr["interface"][protocol_int_name]["backup-bandwidth"]}}
|
set services infra-crt {{device}} mpls-te-frr junos-core-interface {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} backup-bandwidth {{aggregate_unit["mpls-te-frr-backup-bandwidth"]}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{#- RSVP #}
|
{#- RSVP #}
|
||||||
{%- if protocol_int_name in rsvp["interface"] %}
|
{%- if aggregate_unit["rsvp"] == True %}
|
||||||
set services infra-crt {{device}} rsvp core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} core-intf-bandwidth {{rsvp["interface"][protocol_int_name]["core-intf-bandwidth"]}}
|
set services infra-crt {{device}} rsvp core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} core-intf-bandwidth {{aggregate_unit["rsvp-bandwidth"]}}
|
||||||
set services infra-crt {{device}} rsvp core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} core-intf-subscription {{rsvp["interface"][protocol_int_name]["core-intf-subscription"]}}
|
set services infra-crt {{device}} rsvp core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} core-intf-subscription {{aggregate_unit["rsvp-subscription"]}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{#- Service-Policy #}
|
{#- Service-Policy #}
|
||||||
{%- if aggregate_unit["name"] in service_policy["interface"][aggregate_interface["name"]]["units"] %}
|
{%- if aggregate_unit["service-policy"] == True %}
|
||||||
set services infra-crt {{device}} service-policy core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}}
|
set services infra-crt {{device}} service-policy core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}}
|
||||||
{%- if service_policy["interface"][aggregate_interface["name"]]["service-map"] is not none %}
|
{%- if aggregate_interface["service-map"] is not none %}
|
||||||
set services infra-crt {{device}} service-policy core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} service-map {{service_policy["interface"][aggregate_interface["name"]]["service-map"]}}
|
set services infra-crt {{device}} service-policy core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} service-map {{aggregate_interface["service-map"]}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if service_policy["interface"][aggregate_interface["name"]]["shaper-rate"] is not none %}
|
{%- if aggregate_interface["shaper-rate"] is not none %}
|
||||||
set services infra-crt {{device}} service-policy core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} shaper-rate {{service_policy["interface"][aggregate_interface["name"]]["shaper-rate"]}}
|
set services infra-crt {{device}} service-policy core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}} shaper-rate {{aggregate_interface["shaper-rate"]}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
ERROR: Missing Service-Policy for {{aggregate_interface["name"]}} unit {{aggregate_unit["name"]}}!!!
|
ERROR: Missing Service-Policy for {{aggregate_interface["name"]}} unit {{aggregate_unit["name"]}}!!!
|
||||||
set services infra-crt {{device}} service-policy core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}}
|
set services infra-crt {{device}} service-policy core-interface name {{aggregate_interface["name"]}} {{aggregate_unit["name"]}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
{%- for key,member_interface in aggregate_interface["member-interface"].items() %}
|
{%- for key,member_interface in aggregate_interface["member-interface"].items() %}
|
||||||
{%- if member_interface["description"] is not none %}
|
{%- if member_interface["description"] is not none %}
|
||||||
@@ -108,12 +108,14 @@ ERROR: Missing Description for {{aggregate_interface["name"]}} Member-interface
|
|||||||
set services infra-crt {{device}} interface aggregate-interface {{ae_num}} 0 core-interface {{member_interface["name"]}} description FIX_ME
|
set services infra-crt {{device}} interface aggregate-interface {{ae_num}} 0 core-interface {{member_interface["name"]}} description FIX_ME
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
{#- Standard core-interface declaration #}
|
{#- Standard core-interface declaration #}
|
||||||
{%- for key,core_interface in interfaces["core-interface"].items() %}
|
{%- for key,core_interface in interfaces["core-interface"].items() %}
|
||||||
|
{%- if core_interface["disabled"] == False %}
|
||||||
{% for key,core_unit in core_interface["units"].items() %}
|
{% for key,core_unit in core_interface["units"].items() %}
|
||||||
{%- set protocol_int_name = core_interface["name"] ~ '.' ~ core_unit["name"] %}
|
{%- if core_unit["disabled"] == False %}
|
||||||
{%- if core_interface["description"] is not none %}
|
{%- if core_interface["description"] is not none %}
|
||||||
set services infra-crt {{device}} interface core-interface name {{core_interface["name"]}} {{core_unit["name"]}} description {{core_interface["description"]}}
|
set services infra-crt {{device}} interface core-interface name {{core_interface["name"]}} {{core_unit["name"]}} description {{core_interface["description"]}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
@@ -131,53 +133,55 @@ set services infra-crt {{device}} interface core-interface name {{core_interface
|
|||||||
{%- endif %}
|
{%- endif %}
|
||||||
{#- Find Protocols for AE #}
|
{#- Find Protocols for AE #}
|
||||||
{#- ISIS#}
|
{#- ISIS#}
|
||||||
{%- if protocol_int_name in isis["interface"] %}
|
{%- if core_unit["isis"] == True %}
|
||||||
{%- if isis["interface"][protocol_int_name]["passive"] == True %}
|
{%- if core_unit["isis-passive"] == True %}
|
||||||
set services infra-crt {{device}} isis passive-interface name {{core_interface["name"]}} {{core_unit["name"]}}
|
set services infra-crt {{device}} isis passive-interface name {{core_interface["name"]}} {{core_unit["name"]}}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
set services infra-crt {{device}} isis core-interface name {{core_interface["name"]}} {{core_unit["name"]}} metric {{isis["interface"][protocol_int_name]["metric"]}}
|
set services infra-crt {{device}} isis core-interface name {{core_interface["name"]}} {{core_unit["name"]}} metric {{core_unit["isis-l2-metric"]}}
|
||||||
{%- if isis["interface"][protocol_int_name]["enable-bfd"] == True %}
|
{%- if core_unit["isis-inet-enable-bfd"] == True %}
|
||||||
set services infra-crt {{device}} isis core-interface name {{core_interface["name"]}} {{core_unit["name"]}} enable-bfd true
|
set services infra-crt {{device}} isis core-interface name {{core_interface["name"]}} {{core_unit["name"]}} enable-bfd true
|
||||||
set services infra-crt {{device}} isis core-interface name {{core_interface["name"]}} {{core_unit["name"]}} bfd-min-interval {{isis["interface"][protocol_int_name]["bfd-interval"]}}
|
set services infra-crt {{device}} isis core-interface name {{core_interface["name"]}} {{core_unit["name"]}} bfd-min-interval {{core_unit["isis-inet-bfd-interval"]}}
|
||||||
set services infra-crt {{device}} isis core-interface name {{core_interface["name"]}} {{core_unit["name"]}} bfd-multiplier {{isis["interface"][protocol_int_name]["bfd-multiplier"]}}
|
set services infra-crt {{device}} isis core-interface name {{core_interface["name"]}} {{core_unit["name"]}} bfd-multiplier {{core_unit["isis-inet-bfd-multiplier"]}}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
set services infra-crt {{device}} isis core-interface name {{core_interface["name"]}} {{core_unit["name"]}} enable-bfd false
|
set services infra-crt {{device}} isis core-interface name {{core_interface["name"]}} {{core_unit["name"]}} enable-bfd false
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{#- LDP #}
|
{#- LDP #}
|
||||||
{%- if protocol_int_name in ldp["interface"] %}
|
{%- if core_unit["ldp"] == True %}
|
||||||
set services infra-crt {{device}} ldp core-interface name {{core_interface["name"]}} {{core_unit["name"]}}
|
set services infra-crt {{device}} ldp core-interface name {{core_interface["name"]}} {{core_unit["name"]}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{#- MPLS-TE #}
|
{#- MPLS-TE #}
|
||||||
{%- if protocol_int_name in mpls_te["interface"] %}
|
{%- if core_unit["mpls"] == True %}
|
||||||
{%- if mpls_te["interface"][protocol_int_name]["mpls-te-att-names"] is not none %}
|
{%- if none not in core_unit["mpls-te-att-names"] %}
|
||||||
set services infra-crt {{device}} mpls-te core-interface name {{core_interface["name"]}} {{core_unit["name"]}} mpls-te-att-names {{mpls_te["interface"][protocol_int_name]["mpls-te-att-names"]}}
|
set services infra-crt {{device}} mpls-te core-interface name {{core_interface["name"]}} {{core_unit["name"]}} mpls-te-att-names {{core_unit["mpls-te-att-names"]}}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
set services infra-crt {{device}} mpls-te core-interface name {{core_interface["name"]}} {{core_unit["name"]}}
|
set services infra-crt {{device}} mpls-te core-interface name {{core_interface["name"]}} {{core_unit["name"]}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{#- MPLS-TE-FRR #}
|
{#- MPLS-TE-FRR #}
|
||||||
{%- if protocol_int_name in mpls_te_frr["interface"] %}
|
{%- if core_unit["mpls-te-frr-backup-bandwidth"] is not none %}
|
||||||
set services infra-crt {{device}} mpls-te-frr junos-core-interface {{core_interface["name"]}} {{core_unit["name"]}} backup-bandwidth {{mpls_te_frr["interface"][protocol_int_name]["backup-bandwidth"]}}
|
set services infra-crt {{device}} mpls-te-frr junos-core-interface {{core_interface["name"]}} {{core_unit["name"]}} backup-bandwidth {{core_unit["mpls-te-frr-backup-bandwidth"]}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{#- RSVP #}
|
{#- RSVP #}
|
||||||
{%- if protocol_int_name in rsvp["interface"] %}
|
{%- if core_unit["rsvp"] == True %}
|
||||||
set services infra-crt {{device}} rsvp core-interface name {{core_interface["name"]}} {{core_unit["name"]}} core-intf-bandwidth {{rsvp["interface"][protocol_int_name]["core-intf-bandwidth"]}}
|
set services infra-crt {{device}} rsvp core-interface name {{core_interface["name"]}} {{core_unit["name"]}} core-intf-bandwidth {{core_unit["rsvp-bandwidth"]}}
|
||||||
set services infra-crt {{device}} rsvp core-interface name {{core_interface["name"]}} {{core_unit["name"]}} core-intf-subscription {{rsvp["interface"][protocol_int_name]["core-intf-subscription"]}}
|
set services infra-crt {{device}} rsvp core-interface name {{core_interface["name"]}} {{core_unit["name"]}} core-intf-subscription {{core_unit["rsvp-subscription"]}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{#- Service-Policy #}
|
{#- Service-Policy #}
|
||||||
{%- if core_unit["name"] in service_policy["interface"][core_interface["name"]]["units"] %}
|
{%- if core_unit["service-policy"] == True %}
|
||||||
set services infra-crt {{device}} service-policy core-interface name {{core_interface["name"]}} {{core_unit["name"]}}
|
set services infra-crt {{device}} service-policy core-interface name {{core_interface["name"]}} {{core_unit["name"]}}
|
||||||
{%- if service_policy["interface"][core_interface["name"]]["service-map"] is not none %}
|
{%- if core_interface["service-map"] is not none %}
|
||||||
set services infra-crt {{device}} service-policy core-interface name {{core_interface["name"]}} {{core_unit["name"]}} service-map {{service_policy["interface"][core_interface["name"]]["service-map"]}}
|
set services infra-crt {{device}} service-policy core-interface name {{core_interface["name"]}} {{core_unit["name"]}} service-map {{core_interface["service-map"]}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if service_policy["interface"][core_interface["name"]]["shaper-rate"] is not none %}
|
{%- if core_interface["shaper-rate"] is not none %}
|
||||||
set services infra-crt {{device}} service-policy core-interface name {{core_interface["name"]}} {{core_unit["name"]}} shaper-rate {{service_policy["interface"][core_interface["name"]]["shaper-rate"]}}
|
set services infra-crt {{device}} service-policy core-interface name {{core_interface["name"]}} {{core_unit["name"]}} shaper-rate {{core_interface["shaper-rate"]}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
ERROR: Missing Service-Policy for {{core_interface["name"]}} unit {{core_unit["name"]}}!!!
|
ERROR: Missing Service-Policy for {{core_interface["name"]}} unit {{core_unit["name"]}}!!!
|
||||||
set services infra-crt {{device}} service-policy core-interface name {{core_interface["name"]}} {{core_unit["name"]}}
|
set services infra-crt {{device}} service-policy core-interface name {{core_interface["name"]}} {{core_unit["name"]}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|||||||
Reference in New Issue
Block a user