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

Merge branch 'feature/integrate-p-to-pe-into-bc' into 'develop'

`promote_p_to_pe` role points to the common `bc_templates` folder

See merge request !169
parents 2825083c 885ccf9d
No related branches found
No related tags found
1 merge request!169`promote_p_to_pe` role points to the common `bc_templates` folder
Pipeline #89026 passed
Showing
with 24 additions and 455 deletions
dry_run: "True" dry_run: "True"
is_base_config_run: "True" is_base_config_run: "True"
is_verification_workflow: false is_verification_workflow: false
is_pe_promotion_wf: false
verbs: verbs:
- "compile" - "compile"
......
{% if router_role == 'pe' %} {% if router_role == 'pe' or is_pe_promotion_wf %}
{% with static_routes_obj=nokia_pe_static_routes %} {% with static_routes_obj=nokia_pe_static_routes %}
{% include 'router/static_routes.j2' %} {% include 'router/static_routes.j2' %}
{% endwith %} {% endwith %}
......
<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"> <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">
{% if router_role == 'pe' %} {% if router_role == 'pe' or is_pe_promotion_wf %}
{% with bgp_base_obj=pe_bgp_base, bgp_context='bgp_base' %} {% with bgp_base_obj=pe_bgp_base, bgp_context='bgp_base' %}
{% include 'router/bgp_base.j2' %} {% include 'router/bgp_base.j2' %}
{% endwith %} {% endwith %}
......
<router 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"> <router 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">
<router-name>Base</router-name> <router-name>Base</router-name>
<autonomous-system xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes" alu:operation="replace">{{ geant_re_as_number }}</autonomous-system> <autonomous-system xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes" alu:operation="replace">{{ geant_re_as_number }}</autonomous-system>
{% if router_role == 'pe' and pe_bgp_base.ecmp is defined %} {% if (router_role == 'pe' or is_pe_promotion_wf) and pe_bgp_base.ecmp is defined %}
<ecmp>{{ pe_bgp_base.ecmp }}</ecmp> <ecmp>{{ pe_bgp_base.ecmp }}</ecmp>
{% endif %} {% endif %}
{% if not is_pe_promotion_wf %}
<router-id xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes" alu:operation="replace">{{ lo_ipv4_address }}</router-id> <router-id xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes" alu:operation="replace">{{ lo_ipv4_address }}</router-id>
<interface 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"> <interface 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">
<interface-name>system</interface-name> <interface-name>system</interface-name>
...@@ -41,11 +42,12 @@ ...@@ -41,11 +42,12 @@
<interface-name>system</interface-name> <interface-name>system</interface-name>
</interface> </interface>
</rsvp> </rsvp>
{% include 'router/base_static_routes.j2' %}
{% include 'router/bgp.j2' %}
{% include 'router/isis.j2' %} {% include 'router/isis.j2' %}
{% include 'router/pim.j2' %} {% include 'router/pim.j2' %}
{% if router_role == 'pe' %} {% endif %}
{% include 'router/base_static_routes.j2' %}
{% include 'router/bgp.j2' %}
{% if router_role == 'pe' or is_pe_promotion_wf %}
{% include 'router/flowspec.j2' %} {% include 'router/flowspec.j2' %}
{% include 'router/ldp.j2' %} {% include 'router/ldp.j2' %}
{% include 'router/rpki.j2' %} {% include 'router/rpki.j2' %}
......
...@@ -8,5 +8,7 @@ ...@@ -8,5 +8,7 @@
</md-auto-id> </md-auto-id>
{% include 'router/vprn.j2' %} {% include 'router/vprn.j2' %}
</service> </service>
{#{% include 'ip_prefix_list.j2' %}#} {% if is_pe_promotion_wf %}
{% include 'ip_prefix_list.j2' %}
{% endif %}
...@@ -15,21 +15,21 @@ ...@@ -15,21 +15,21 @@
mode: '0755' mode: '0755'
delegate_to: localhost delegate_to: localhost
- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/pe_base_config.conf" - name: Print the template in "/var/tmp/ansible_run_{{ opid }}/pe_promotion_base_config.conf"
when: verb == "deploy_pe_base_config" when: verb == "deploy_pe_base_config"
ansible.builtin.template: ansible.builtin.template:
src: "routers/{{ subscription.router.vendor }}/pe_base_config.j2" src: "routers/{{ subscription.router.vendor }}/pe_promotion_base_config.j2"
dest: "/var/tmp/ansible_run_{{ opid }}/pe_base_config.conf" dest: "/var/tmp/ansible_run_{{ opid }}/pe_promotion_base_config.conf"
lstrip_blocks: true lstrip_blocks: true
trim_blocks: true trim_blocks: true
mode: '0755' mode: '0755'
delegate_to: localhost delegate_to: localhost
- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/pe_base_vprn.conf" - name: Print the template in "/var/tmp/ansible_run_{{ opid }}/pe_promotion_base_vprn.conf"
when: verb == "deploy_routing_instances" when: verb == "deploy_routing_instances"
ansible.builtin.template: ansible.builtin.template:
src: "routers/{{ subscription.router.vendor }}/pe_base_vprn.j2" src: "routers/{{ subscription.router.vendor }}/pe_promotion_base_vprn.j2"
dest: "/var/tmp/ansible_run_{{ opid }}/pe_base_vprn.conf" dest: "/var/tmp/ansible_run_{{ opid }}/pe_promotion_base_vprn.conf"
lstrip_blocks: true lstrip_blocks: true
trim_blocks: true trim_blocks: true
mode: '0755' mode: '0755'
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
geant.gap_ansible.nokia_netconf_config: geant.gap_ansible.nokia_netconf_config:
format: xml format: xml
default_operation: merge default_operation: merge
content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/pe_base_config.j2') }}" content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/pe_promotion_base_config.j2') }}"
commit: true commit: true
validate: true validate: true
diff: true diff: true
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
geant.gap_ansible.nokia_netconf_config: geant.gap_ansible.nokia_netconf_config:
format: xml format: xml
default_operation: merge default_operation: merge
content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/pe_base_vprn.j2') }}" content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/pe_promotion_base_vprn.j2') }}"
commit: true commit: true
validate: true validate: true
diff: true diff: true
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
geant.gap_ansible.nokia_netconf_config: geant.gap_ansible.nokia_netconf_config:
format: xml format: xml
default_operation: merge default_operation: merge
content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/pe_base_config.j2') }}" content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/pe_promotion_base_config.j2') }}"
commit: true commit: true
commit_comment: "{{ commit_comment }}" commit_comment: "{{ commit_comment }}"
diff: true diff: true
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
geant.gap_ansible.nokia_netconf_config: geant.gap_ansible.nokia_netconf_config:
format: xml format: xml
default_operation: merge default_operation: merge
content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/pe_base_vprn.j2') }}" content: "{{ lookup('ansible.builtin.template', 'routers/{{ subscription.router.vendor }}/pe_promotion_base_vprn.j2') }}"
commit: true commit: true
commit_comment: "{{ commit_comment }}" commit_comment: "{{ commit_comment }}"
diff: true diff: true
......
../bc_templates
\ No newline at end of file
<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
{% 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 %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment