Skip to content
Snippets Groups Projects
Commit 79eef4f1 authored by Aleksandr Kurbatov's avatar Aleksandr Kurbatov
Browse files

promoto_p_to_pe templates

deleted in role, to use the common `bc_templates` folder
parent 81762680
No related branches found
No related tags found
1 merge request!169`promote_p_to_pe` role points to the common `bc_templates` folder
Showing
with 0 additions and 736 deletions
<cflowd xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes" alu:operation="replace">
<cache-size>{{ cflowd.basic.cache_size }}</cache-size>
<enhanced-distribution>{{ cflowd.basic.enhanced_distribution }}</enhanced-distribution>
<overflow>{{ cflowd.basic.overflow }}</overflow>
<template-retransmit>{{ cflowd.basic.template_retransmit }}</template-retransmit>
<active-flow-timeout>{{ cflowd.basic.active_flow_timeout }}</active-flow-timeout>
<inactive-flow-timeout>{{ cflowd.basic.inactive_flow_timeout }}</inactive-flow-timeout>
{% if cflowd.sample_profiles is defined %}
{% for profile in cflowd.sample_profiles %}
<sample-profile>
<profile-id>{{ profile.id }}</profile-id>
<sample-rate>{{ profile.sample_rate }}</sample-rate>
<metering-process>{{ profile.metering_process }}</metering-process>
</sample-profile>
{% endfor %}
{% endif %}
{% if cflowd.collectors is defined %}
{% for collector in cflowd.collectors %}
<collector>
<ip-address>{{ collector.ip }}</ip-address>
<port>{{ collector.port }}</port>
<description>{{ collector.description }}</description>
<template-set>{{ collector.template_set }}</template-set>
<version>{{ collector.version }}</version>
</collector>
{% endfor %}
{% endif %}
</cflowd>
<filter xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes">
{% if pe_filter_logs is defined %}
{% for log in pe_filter_logs %}
<log alu:operation="replace">
<log-id>{{ log.id }}</log-id>
<description>{{ log.description }}</description>
<destination>
{% if log.destination == 'syslog' %}
<syslog>
<name>1</name>
</syslog>
{% endif %}
</destination>
</log>
{% endfor %}
{% endif %}
</filter>
{% with is_cpm_filter=true, filters=cpm_filters %}
{% include "filters/port_list_definitions.j2" %}
<system>
<security>
<cpm-filter xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes">
<default-action>{{ cpm_filter_policy.default_action }}</default-action>
{% include "filters/fw_filters.j2" %}
</cpm-filter>
{% endwith %}
</security>
</system>
{# Template is meant to be called from either gen_filters.j2 or cmp_filters.j2 #}
{% for filter in filters %}
{% if filter.family == "ipv4" %}
<ip-filter alu:operation="replace">
{% elif filter.family == "ipv6" %}
<ipv6-filter alu:operation="replace">
{% endif %}
{% if not is_cpm_filter %}
<filter-name>{{ filter.name }}</filter-name>
{% endif %}
{% if filter.offset is defined %}
{% set ns3 = namespace(entry_id = filter.offset | int) %}
{% else %}
{% set ns3 = namespace(entry_id = 10 | int) %}
{% endif %}
{% if is_cpm_filter %}
<admin-state>{{ filter.admin_state }}</admin-state>
{% endif %}
{% for term in filter.terms %}
{% if term.offset is defined %}
{% set ns3 = namespace(entry_id = term.offset | int) %}
{% endif %}
{% if term.from is not defined %}
<entry>
<entry-id>{{ ns3.entry_id }}</entry-id>
<description>{{ term.name }}</description>
{% if term.log is defined %}
<log>{{ term.log }}</log>
{% endif %}
<action>
<{{term.action}}></{{term.action}}>
</action>
</entry>
{% endif %}
{% if term.from is defined %}
{# This is the case for TCP_ESTABLISHED #}
{% if term.from.protocol is defined and term.from.protocol == "tcp" and term.from.tcp_flag is defined %}
<entry>
<entry-id>{{ ns3.entry_id }}</entry-id>
<description>{{ term.name }}</description>
{% if term.log is defined %}
<log>{{ term.log }}</log>
{% endif %}
<match>
{% if filter.family == "ipv4" %}
<protocol>{{ term.from.protocol }}</protocol>
{% else %}
<next-header>{{ term.from.protocol }}</next-header>
{% endif %}
<tcp-flags>
<{{ term.from.tcp_flag }}>true</{{ term.from.tcp_flag }}>
</tcp-flags>
</match>
<action>
<{{ term.action }}></{{ term.action }}>
</action>
</entry>
{% set ns3.entry_id = ns3.entry_id + 10 %}
{% endif %}
{# This is to cover CPM-ipv6 ND case where dst_prefix_list is defined, but not src_prefix_list #}
{% if term.from.protocol is defined and term.from.protocol == "ipv6-icmp" and term.from.dst_prefix_list is defined %}
{% for dst_prefix_list_item in term.from.dst_prefix_list %}
<entry>
<entry-id>{{ ns3.entry_id }}</entry-id>
<description>{{ term.name }}</description>
{% if term.log is defined %}
<log>{{ term.log }}</log>
{% endif %}
<match>
<next-header>{{ term.from.protocol }}</next-header>
<dst-ip>
<ipv6-prefix-list>{{term.from.dst_prefix_list[loop.index0]}}</ipv6-prefix-list>
</dst-ip>
</match>
<action>
<{{ term.action }}></{{ term.action }}>
</action>
</entry>
{% set ns3.entry_id = ns3.entry_id + 10 %}
{% endfor %}
{% endif %}
{# Generic ICMP filters with ICMP types #}
{% if term.from.protocol is defined and (term.from.protocol == "icmp" or term.from.protocol == "ipv6-icmp") %}
{% if term.from.icmp_types is defined %}
{% for icmp_type in term.from.icmp_types %}
<entry>
<entry-id>{{ ns3.entry_id }}</entry-id>
<description>{{ term.name }}</description>
{% if term.log is defined %}
<log>{{ term.log }}</log>
{% endif %}
<match>
{% if filter.family == "ipv4" %}
<protocol>{{ term.from.protocol }}</protocol>
{% else %}
<next-header>{{ term.from.protocol }}</next-header>
{% endif %}
<icmp>
<type>{{ icmp_type }}</type>
</icmp>
</match>
<action>
<{{ term.action }}></{{ term.action }}>
</action>
</entry>
{% set ns3.entry_id = ns3.entry_id + 10 %}
{% endfor %}
{% endif %}
{% endif %}
{# Case when only need to match on protocol, e.g. PIM #}
{% if term.from.protocol is defined and term.from.protocol in ['pim', '58'] %}
<entry>
<entry-id>{{ ns3.entry_id }}</entry-id>
<description>{{ term.name }}</description>
{% if term.log is defined %}
<log>{{ term.log }}</log>
{% endif %}
<match>
{% if filter.family == "ipv4" %}
<protocol>{{ term.from.protocol }}</protocol>
{% else %}
<next-header>{{ term.from.protocol }}</next-header>
{% endif %}
</match>
<action>
<{{ term.action }}></{{ term.action }}>
</action>
</entry>
{% set ns3.entry_id = ns3.entry_id + 10 %}
{% endif %}
{# Case when both src_prefix_list and dst_prefix_list are defined #}
{% if term.from.src_prefix_list is defined %}
{% for src_prefix_list_item in term.from.src_prefix_list%}
{% set src_index = loop.index0 %}
{% if term.from.dst_prefix_list is defined %}
{% for dst_prefix_list_item in term.from.dst_prefix_list %}
<entry>
<entry-id>{{ ns3.entry_id }}</entry-id>
<description>{{ term.name }}</description>
{% if term.log is defined %}
<log>{{ term.log }}</log>
{% endif %}
<match>
{% if term.from.protocol is defined %}
{% if filter.family == "ipv4" %}
<protocol>{{term.from.protocol}}</protocol>
{% else %}
<next-header>{{ term.from.protocol }}</next-header>
{% endif %}
{% endif %}
{% include 'filters/port_list_entries.j2' %}
<src-ip>
{% if filter.family == "ipv4" %}
<ip-prefix-list>{{term.from.src_prefix_list[src_index]}}</ip-prefix-list>
{% else %}
<ipv6-prefix-list>{{term.from.src_prefix_list[src_index]}}</ipv6-prefix-list>
{% endif %}
</src-ip>
<dst-ip>
{% if filter.family == "ipv4" %}
<ip-prefix-list>{{term.from.dst_prefix_list[loop.index0]}}</ip-prefix-list>
{% else %}
<ipv6-prefix-list>{{term.from.dst_prefix_list[loop.index0]}}</ipv6-prefix-list>
{% endif %}
</dst-ip>
</match>
{% set ns3.entry_id = ns3.entry_id + 10 %}
<action>
<{{term.action}}></{{term.action}}>
</action>
</entry>
{% endfor %}
{% else %}
{# This is the case of CPM-filters, where destination prefix is not defined #}
<entry>
<entry-id> {{ ns3.entry_id }} </entry-id>
<description>{{ term.name }}</description>
{% if term.log is defined %}
<log>{{ term.log }}</log>
{% endif %}
<match>
{% if term.from.protocol is defined %}
{% if filter.family == "ipv4" %}
<protocol>{{term.from.protocol}}</protocol>
{% else %}
<next-header>{{ term.from.protocol }}</next-header>
{% endif %}
{% endif %}
{% include 'filters/port_list_entries.j2' %}
<src-ip>
{% if filter.family == "ipv4" %}
<ip-prefix-list>{{term.from.src_prefix_list[src_index]}}</ip-prefix-list>
{% else %}
<ipv6-prefix-list>{{term.from.src_prefix_list[src_index]}}</ipv6-prefix-list>
{% endif %}
</src-ip>
</match>
{% set ns3.entry_id = ns3.entry_id + 10 %}
<action>
<{{term.action}}></{{term.action}}>
</action>
</entry>
{% endif %}
{% endfor %}
{% endif %}
{# Case where only DST prefix list is defined #}
{% if term.from.dst_prefix_list is defined %}
{% for dst_prefix_list_item in term.from.dst_prefix_list %}
<entry>
<entry-id>{{ ns3.entry_id }}</entry-id>
<description>{{ term.name }}</description>
{% if term.log is defined %}
<log>{{ term.log }}</log>
{% endif %}
<match>
{% if term.from.protocol is defined %}
{% if filter.family == "ipv4" %}
<protocol>{{term.from.protocol}}</protocol>
{% else %}
<next-header>{{ term.from.protocol }}</next-header>
{% endif %}
{% endif %}
{% include 'filters/port_list_entries.j2' %}
<dst-ip>
{% if filter.family == "ipv4" %}
<ip-prefix-list>{{term.from.dst_prefix_list[loop.index0]}}</ip-prefix-list>
{% else %}
<ipv6-prefix-list>{{term.from.dst_prefix_list[loop.index0]}}</ipv6-prefix-list>
{% endif %}
</dst-ip>
</match>
{% set ns3.entry_id = ns3.entry_id + 10 %}
<action>
<{{term.action}}></{{term.action}}>
</action>
</entry>
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
{# Terms end #}
{% if filter.family == "ipv4" %}
</ip-filter>
{% elif filter.family == "ipv6" %}
</ipv6-filter>
{% endif %}
{% endfor %}
{# This template takes care of configuring connectors and breakouts #}
{% with is_cpm_filter=False, filters=gen_filters %}
{% include "filters/port_list_definitions.j2" %}
<filter xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes">
{% include "filters/fw_filters.j2" %}
</filter>
{% endwith %}
{# This template takes care of configuring connectors and breakouts #}
<filter xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes">
<match-list>
{% for filter in filters %}
{% for term in filter.terms %}
{% if term.from.port is defined and term.from.port.__class__.__name__ == 'list'%}
<port-list>
<port-list-name>{{filter.name}}-{{term.name}}-PORTS</port-list-name>
{%for port in term.from.port %}
<port>
<value>{{port}}</value>
</port>
{% endfor %}
</port-list>
{% endif %}
{% if term.from.src_port is defined and term.from.src_port.__class__.__name__ == 'list'%}
<port-list>
<port-list-name>{{filter.name}}-{{term.name}}-SRC_PORTS</port-list-name>
{%for port in term.from.src_port %}
<port>
<value>{{port}}</value>
</port>
{% endfor %}
</port-list>
{% endif %}
{% if term.from.dst_port is defined and term.from.dst_port.__class__.__name__ == 'list'%}
<port-list>
<port-list-name>{{filter.name}}-{{term.name}}-DST_PORTS</port-list-name>
{%for port in term.from.dst_port %}
<port>
<value>{{port}}</value>
</port>
{% endfor %}
</port-list>
{% endif %}
{% if term.from.port_range is defined %}
<port-list>
<port-list-name>{{filter.name}}-{{term.name}}-PORT_RANGE</port-list-name>
<range>
<start>{{ term.from.port_range.start }}</start>
<end>{{ term.from.port_range.end }}</end>
</range>
</port-list>
{% endif %}
{% if term.from.src_port_range is defined %}
<port-list>
<port-list-name>{{filter.name}}-{{term.name}}-SRC_PORT_RANGE</port-list-name>
<range>
<start>{{ term.from.src_port_range.start }}</start>
<end>{{ term.from.src_port_range.end }}</end>
</range>
</port-list>
{% endif %}
{% if term.from.dst_port_range is defined %}
<port-list>
<port-list-name>{{filter.name}}-{{term.name}}-DST_PORT_RANGE</port-list-name>
<range>
<start>{{ term.from.dst_port_range.start }}</start>
<end>{{ term.from.dst_port_range.end }}</end>
</range>
</port-list>
{% endif %}
{% endfor %}
{% endfor %}
</match-list>
</filter>
{#This is the case it's a port-list #}
{% if term.from.port is defined and term.from.port.__class__.__name__ == 'list'%}
<port>
<port-list>{{filter.name}}-{{term.name}}-PORTS</port-list>
</port>
{% endif %}
{% if term.from.src_port is defined and term.from.src_port.__class__.__name__ == 'list'%}
<src-port>
<port-list>{{filter.name}}-{{term.name}}-SRC_PORTS</port-list>
</src-port>
{% endif %}
{% if term.from.dst_port is defined and term.from.dst_port.__class__.__name__ == 'list'%}
<dst-port>
<port-list>{{filter.name}}-{{term.name}}-DST_PORTS</port-list>
</dst-port>
{% endif %}
{#This is the case it's a single port #}
{% if term.from.port is defined and term.from.port.__class__.__name__ != 'list'%}
<port>
<eq>{{term.from.port}}</eq>
</port>
{% endif %}
{% if term.from.src_port is defined and term.from.src_port.__class__.__name__ != 'list'%}
<src-port>
<eq>{{term.from.src_port}}</eq>
</src-port>
{% endif %}
{% if term.from.dst_port is defined and term.from.dst_port.__class__.__name__ != 'list'%}
<dst-port>
<eq>{{term.from.dst_port}}</eq>
</dst-port>
{% endif %}
{# Port range #}
{% if term.from.port_range is defined %}
<port>
<port-list>{{filter.name}}-{{term.name}}-PORT_RANGE</port-list>
</port>
{% endif %}
{% if term.from.src_port_range is defined %}
<src-port>
<port-list>{{filter.name}}-{{term.name}}-SRC_PORT_RANGE</port-list>
</src-port>
{% endif %}
{% if term.from.dst_port_range is defined %}
<dst-port>
<port-list>{{filter.name}}-{{term.name}}-DST_PORT_RANGE</port-list>
</dst-port>
{% endif %}
../../../../base_config/templates/routers/nokia/ip_prefix_list.j2
\ No newline at end of file
<config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:alu="urn:ietf:params:xml:ns:netconf:base:1.0">
<configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf">
{% include 'filter_log.j2' %}
{% include 'ip_prefix_list.j2' %}
{% include 'filters/cpm_filters.j2' %}
{% include 'policy_options/policy_options.j2' %}
{% include 'cflowd.j2' %}
{% include 'system/security/security.j2' %}
{% include 'router/router_base.j2' %}
{% include 'sdp_mesh.j2' %}
</configure>
</config>
<config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:alu="urn:ietf:params:xml:ns:netconf:base:1.0">
<configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf">
{% include 'service_vprn.j2' %}
</configure>
</config>
<config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:alu="urn:ietf:params:xml:ns:netconf:base:1.0">
<configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf">
{% include 'sdp_mesh.j2' %}
</configure>
</config>
{% for as_path in as_paths_obj %}
<as-path alu:operation="replace">
<name>{{ as_path.name }}</name>
<expression>{{ as_path.expression}}</expression>
</as-path>
{% endfor %}
{% for community in communities_obj %}
<community alu:operation="replace">
<name>{{ community.name }}</name>
<member>
<member>{{ community.member }}</member>
</member>
</community>
{% endfor %}
<policy-options xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes">
{% if nokia_po_prefix_lists is defined %}
{% with prefix_lists_obj=nokia_po_prefix_lists %}
{% include 'policy_options/prefix_lists.j2' %}
{% endwith %}
{% endif %}
{# Communities #}
{% if nokia_po_communities is defined %}
{% with communities_obj=nokia_po_communities %}
{% include 'policy_options/communities.j2' %}
{% endwith %}
{% endif %}
{# AS paths #}
{% if nokia_po_as_paths is defined %}
{% with as_paths_obj=nokia_po_as_paths %}
{% include 'policy_options/as_paths.j2' %}
{% endwith %}
{% endif %}
{# Policy statements #}
{% if nokia_po_policy_statements is defined %}
{% with policy_obj=nokia_po_policy_statements %}
{% include 'policy_options/policy_statements.j2' %}
{% endwith %}
{% endif %}
</policy-options>
{% for pol in policy_obj %}
<policy-statement alu:operation="replace">
<name>{{ pol.name }}</name>
<entry-type>{{ pol.entry_type }}</entry-type>
{% for entry in pol.entries %}
{% if pol.entry_type == 'named' %}
<named-entry>
{% endif %}
<entry-name>{{ entry.name }}</entry-name>
{% if entry.from is defined %}
<from>
{% if entry.from.as_path is defined %}
<as-path>
{% if entry.from.as_path.name is defined %}
<name>{{ entry.from.as_path.name }}</name>
{% endif %}
{% if entry.from.as_path.length is defined %}
<length>
<value>{{ entry.from.as_path.length }}</value>
</length>
{% endif %}
</as-path>
{% endif %}
{% if entry.from.prefix_list is defined %}
{% for pl in entry.from.prefix_list %}
<prefix-list>{{ pl }}</prefix-list>
{% endfor %}
{% endif %}
{% if entry.from.community is defined %}
<community>
<name>{{ entry.from.community }}</name>
</community>
{% endif %}
{% if entry.from.origin_validation_state is defined %}
<origin-validation-state>{{ entry.from.origin_validation_state }}</origin-validation-state>
{% endif %}
{% if entry.from.protocol is defined %}
{% for proto in entry.from.protocol %}
<protocol>
<name>{{ proto }}</name>
</protocol>
{% endfor %}
{% endif %}
</from>
{% endif %}
<action>
<action-type>{{ entry.action_type }}</action-type>
{% if entry.action is defined %}
{% for action_item in entry.action %}
{% for act_k, act_v in action_item.items() %}
{% if act_k == "community_add" %}
<community>
<add>{{ act_v }}</add>
</community>
{% else %}
<{{ act_k | replace("_", "-") }}>{{ act_v }}</{{act_k | replace("_", "-") }}>
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}
</action>
</named-entry>
{% endfor %}
</policy-statement>
{% endfor %}
{% for prefix_list in prefix_lists_obj %}
<prefix-list alu:operation="replace">
<name>{{ prefix_list.name }}</name>
{% for prefix in prefix_list.prefixes %}
<prefix>
<ip-prefix>{{ prefix.ip }}</ip-prefix>
<type>{{ prefix.type }}</type>
{% if prefix.type == 'range' %}
<start-length>{{ prefix.range_start_length }}</start-length>
<end-length>{{ prefix.range_end_length }}</end-length>
{% endif %}
</prefix>
{% endfor %}
</prefix-list>
{% endfor %}
<static-routes xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes">
{% with static_routes_obj=nokia_pe_static_routes %}
{% include 'router/static_routes.j2' %}
{% endwith %}
</static-routes>
<bgp xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes">
{% with bgp_base_obj=pe_bgp_base, bgp_context='bgp_base' %}
{% include 'router/bgp_base.j2' %}
{% endwith %}
{% with bgp_obj=pe_bgp_tools %}
{% include "router/bgp_group.j2" %}
{% include "router/bgp_neighbor.j2" %}
{% endwith %}
{% with bgp_obj=pe_bgp_internal %}
{% include "router/bgp_group.j2" %}
{% endwith %}
</bgp>
{% if bgp_context == 'vprn' %}
{% if bgp_base_obj.families is defined %}
{% for fam in bgp_base_obj.families %}
<{{ fam }}>true</{{ fam }}>
{% endfor %}
{% endif %}
{% endif %}
{% if bgp_base_obj.best_path_selection is defined %}
<best-path-selection>
{% for bps in bgp_base_obj.best_path_selection %}
<{{ bps }}>true</{{ bps }}>
{% endfor %}
</best-path-selection>
{% endif %}
{% if bgp_base_obj.error_handling is defined %}
<error-handling>
<{{ bgp_base_obj.error_handling }}>true</{{ pe_bgp_base.error_handling }}>
</error-handling>
{% endif %}
{% if bgp_base_obj.next_hop_resolution.shortcut_tunnel is defined %}
<next-hop-resolution>
<shortcut-tunnel>
{% for nhr in bgp_base_obj.next_hop_resolution.shortcut_tunnel %}
<family>
<family-type>{{ nhr.type }}</family-type>
<resolution-filter>
<{{ nhr.resolution_filter }}>true</{{ nhr.resolution_filter }}>
</resolution-filter>
</family>
{% endfor %}
</shortcut-tunnel>
</next-hop-resolution>
{% endif %}
{% if bgp_base_obj.multipath is defined %}
<multipath alu:operation="replace">
{% if bgp_base_obj.multipath.ibgp is defined %}
<ibgp>{{ bgp_base_obj.multipath.ibgp }}</ibgp>
{% endif %}
{% if bgp_base_obj.multipath.ebgp is defined %}
<ebgp>{{ bgp_base_obj.multipath.ebgp }}</ebgp>
{% endif %}
{% if bgp_base_obj.multipath.ipv4 is defined %}
<family>
<family-type>ipv4</family-type>
<max-paths>{{ bgp_base_obj.multipath.ipv4 }}</max-paths>
</family>
{% endif %}
{% if bgp_base_obj.multipath.ipv6 is defined %}
<family>
<family-type>ipv6</family-type>
<max-paths>{{ bgp_base_obj.multipath.ipv6 }}</max-paths>
</family>
{% endif %}
</multipath>
{% endif %}
{% for group in bgp_obj.groups %}
<group alu:operation="replace">
<group-name>{{ group.name }}</group-name>
<admin-state>{{ group.admin_state | default('enable') }}</admin-state>
{% if group.auth_key is defined %}
<authentication-key>{{ group.auth_key }}</authentication-key>
{% endif %}
{% if group.nhs is defined %}
<next-hop-self>{{ group.nhs }}</next-hop-self>
{% endif %}
<type>{{ group.type }}</type>
{% if group.bfd_liveness is defined %}
<bfd-liveness>{{ group.bfd_liveness }}</bfd-liveness>
{% endif %}
{% if group.ebgp_default_reject is defined %}
<ebgp-default-reject-policy>
{% for pk, pv in group.ebgp_default_reject.items() %}
<{{ pk }}>{{ pv }}</{{ pk }}>
{% endfor %}
</ebgp-default-reject-policy>
{% endif %}
{% if group.peer_as is defined %}
<peer-as>{{ group.peer_as }}</peer-as>
{% endif %}
{% if group.local_as is defined %}
<local-as>
<as-number>{{ group.local_as }}</as-number>
{% if group.prepend_global_as is defined %}
<prepend-global-as>{{ group.prepend_global_as }}</prepend-global-as>
{% endif %}
</local-as>
{% endif %}
{% if group.capability_neg is defined %}
<capability-negotiation>{{ group.capability_neg }}</capability-negotiation>
{% endif %}
{% if bgp_group_context != 'vprn' %}
{% if (group.local_address is defined) and group.local_address == 'ipv4' %}
<local-address>{{ lo_ipv4_address }}</local-address>
{% elif (group.local_address is defined) and group.local_address == 'ipv6' %}
<local-address>{{ lo_ipv6_address }}</local-address>
{% endif %}
{% endif %}
{% if group.hold_time is defined %}
<hold-time>
<seconds>{{ group.hold_time }}</seconds>
</hold-time>
{% endif %}
{% if group.origin_validattion is defined %}
<origin-validation>
{% for ov in group.origin_validattion %}
<{{ ov }}>true</{{ ov }}>
{% endfor %}
</origin-validation>
{% endif %}
{% if group.send_communities is defined %}
<send-communities>
{% for sc_k, sc_v in group.send_communities.items() %}
<{{ sc_k }}>{{ sc_v }}</{{ sc_k }}>
{% endfor %}
</send-communities>
{% endif %}
{% if group.families is defined %}
<family>
{% for family in group.families %}
<{{ family }}>true</{{ family }}>
{% endfor %}
</family>
{% endif %}
{% if group.policies.import is defined %}
<import>
{% for imp_pol in group.policies.import %}
<policy>{{ imp_pol }}</policy>
{% endfor %}
</import>
{% endif %}
{% if group.policies.export is defined %}
<export>
{% for exp_pol in group.policies.export %}
<policy>{{ exp_pol }}</policy>
{% endfor %}
</export>
{% endif %}
</group>
{% endfor %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment