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
Branches
Tags
1 merge request!169`promote_p_to_pe` role points to the common `bc_templates` folder
Showing
with 0 additions and 253 deletions
{% for neighbor in bgp_obj.neighbors %}
<neighbor alu:operation="replace">
<ip-address>{{ neighbor.ip }}</ip-address>
<description>{{ neighbor.description }}</description>
<group>{{ neighbor.group }}</group>
{% if neighbor.auth_key is defined %}
<authentication-key>{{ neighbor.auth_key }}</authentication-key>
{% endif %}
{% if neighbor.hold_time is defined %}
<hold-time>
<seconds>{{ neighbor.hold_time }}</seconds>
</hold-time>
{% endif %}
{% if neighbor.families is defined %}
<family>
{% for family in neighbor.families %}
<{{ family }}>true</{{ family }}>
{% endfor %}
</family>
{% endif %}
{% if neighbor.policies.import is defined %}
<import>
{% for imp_pol in neighbor.policies.import %}
<policy>{{ imp_pol }}</policy>
{% endfor %}
</import>
{% endif %}
{% if neighbor.policies.export is defined %}
<export>
{% for exp_pol in neighbor.policies.export %}
<policy>{{ exp_pol }}</policy>
{% endfor %}
</export>
{% endif %}
{% if neighbor.cluster_id is defined %}
<cluster>
{% if neighbor.cluster_id == 'system' %}
<cluster-id>{{ lo_ipv4_address }}</cluster-id>
{% else %}
<cluster-id>{{ neighbor.cluster_id }}</cluster-id>
{% endif %}
</cluster>
{% endif %}
</neighbor>
{% endfor %}
<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">
<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>
<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">
{% for route in nokia_static_routes %}
<route alu:operation="delete">
<ip-prefix>{{ route.ip_prefix }}</ip-prefix>
<route-type>{{ route.route_type }}</route-type>
</route>
{% endfor %}
</static-routes>
</router>
</configure>
</config>
<flowspec alu:operation="replace">
<ip-filter-max-size>{{ nokia_flowspec.ip_filter_max_size }}</ip-filter-max-size>
<ipv6-filter-max-size>{{ nokia_flowspec.ipv6_filter_max_size }}</ipv6-filter-max-size>
</flowspec>
<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">
<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>
<isis>
<isis-instance>0</isis-instance>
{% if verb == 'set_isis_overload' %}
<overload 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">
</overload>
{% endif %}
{% if verb == 'remove_isis_overload' %}
<overload 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="delete">
</overload>
{% endif %}
</isis>
</router>
</configure>
</config>
<ldp 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">
<admin-state>enable</admin-state>
<targeted-session>
<sdp-auto-targeted-session>true</sdp-auto-targeted-session>
</targeted-session>
</ldp>
<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>
{% with static_routes_obj=nokia_pe_static_routes %}
{% include 'router/static_routes.j2' %}
{% endwith %}
{% with bgp_group_context='bgp_base' %}
{% include 'router/bgp.j2' %}
{% endwith %}
{% include 'router/flowspec.j2' %}
{% include 'router/ldp.j2' %}
{% include 'router/rpki.j2' %}
</router>
<origin-validation 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">
{% for validator in pe_rpki.validators %}
<rpki-session alu:operation="replace">
<ip-address>{{ validator.ip }}</ip-address>
<admin-state>{{ validator.admin_state | default('enable') }}</admin-state>
<connect-retry>{{ validator.connect_retry }}</connect-retry>
<local-address>{{ lo_ipv4_address }}</local-address>
<port>{{ validator.port }}</port>
<stale-time>{{ validator.stale_time }}</stale-time>
</rpki-session>
{% endfor %}
</origin-validation>
<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">
{% for route in static_routes_obj %}
<route alu:operation="replace">
<ip-prefix>{{ route.ip_prefix }}</ip-prefix>
<route-type>{{ route.route_type }}</route-type>
{% if route.indirect is defined %}
{% for ir in route.indirect %}
<indirect>
<ip-address>{{ ir.next_hop }}</ip-address>
<admin-state>{{ ir.admin_state }}</admin-state>
{% if ir.description is defined %}
<description>{{ ir.description }}</description>
{% endif %}
{% if ir.preference is defined %}
<preference>{{ ir.preference }}</preference>
{% endif %}
</indirect>
{% endfor %}
{% endif %}
{# Blackhole #}
{% if route.blackhole is defined %}
<blackhole>
<admin-state>{{ route.blackhole.admin_state }}</admin-state>
{% if route.blackhole.description is defined %}
<description>{{ route.blackhole.description }}</description>
{% endif %}
</blackhole>
{% endif %}
{# Communities #}
{% if route.communities is defined %}
{% for community in route.communities %}
<community>{{ community }}</community>
{% endfor %}
{% endif %}
</route>
{% endfor %}
</static-routes>
{% for vprn in pe_vprns %}
<vprn alu:operation="replace">
<service-name>{{ vprn.name }}</service-name>
<admin-state>{{ vprn.admin_state | default('enable') }}</admin-state>
{% if vprn.description is defined %}
<description>{{ vprn.description }}</description>
{% endif %}
<service-id>{{ vprn.service_id }}</service-id>
<customer>{{ vprn.customer_id }}</customer>
<autonomous-system>{{ vprn.asn }}</autonomous-system>
<bgp-ipvpn>
<mpls>
<admin-state>enable</admin-state>
<route-distinguisher>{{ vprn.bgp_ipvpn.mpls.rd }}</route-distinguisher>
<vrf-target>
<community>{{ vprn.bgp_ipvpn.mpls.target }}</community>
</vrf-target>
<auto-bind-tunnel>
<resolution>{{ vprn.bgp_ipvpn.mpls.auto_bind_tunnel.resolution }}</resolution>
<resolution-filter>
<{{ vprn.bgp_ipvpn.mpls.auto_bind_tunnel.resolution_filter }}>true</{{ vprn.bgp_ipvpn.mpls.auto_bind_tunnel.resolution_filter }}>
</resolution-filter>
</auto-bind-tunnel>
</mpls>
</bgp-ipvpn>
<bgp>
{% with bgp_base_obj=vprn.bgp, bgp_context='vprn' %}
{% include 'router/bgp_base.j2' %}
{% endwith %}
{% with bgp_obj=vprn.bgp, bgp_group_context='vprn' %}
{% include 'router/bgp_group.j2' %}
{% endwith %}
</bgp>
{% if vprn.static_routes is defined %}
{% with static_routes_obj=vprn.static_routes %}
{% include 'router/static_routes.j2' %}
{% endwith %}
{% endif %}
{% if vprn.flowspec is defined %}
<flowspec>
<ip-filter-max-size>{{ vprn.flowspec.ip_filter_max_size }}</ip-filter-max-size>
<ipv6-filter-max-size>{{ vprn.flowspec.ipv6_filter_max_size }}</ipv6-filter-max-size>
</flowspec>
{% endif %}
</vprn>
{% endfor %}
<service 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">
{% for pe_fqdn, pe_addr in pe_router_list.items() %}
{% set sdp_id = pe_addr.lo4 | replace(sdp_prefix_regex, '') | replace('.', '') + sdp_type.id %}
<sdp>
<sdp-id>{{ sdp_id }}</sdp-id>
<admin-state>enable</admin-state>
<description>SDP_{{ sdp_id }}</description>
<delivery-type>mpls</delivery-type>
<path-mtu>{{ sdp_type.path_mtu }}</path-mtu>
{% if sdp_type.signaling is defined %}
<signaling>{{ sdp_type.signaling}}</signaling>
{% endif %}
<sr-isis>{{ sdp_type.sr_isis | lower }}</sr-isis>
<far-end>
<ip-address>{{ pe_addr.lo4 }}</ip-address>
</far-end>
</sdp>
{% endfor %}
</service>
<service 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">
<md-auto-id>
<service-id-range alu:operation="replace">
<start>{{ pe_service.md_auto_id.service_id_range.start | default('10001') }}</start>
<end>{{ pe_service.md_auto_id.service_id_range.end | default('19999') }}</end>
</service-id-range>
</md-auto-id>
{% include 'router/vprn.j2' %}
</service>
{% include 'ip_prefix_list.j2' %}
<system>
<security>
{% with nokia_applications=pe_nokia_applications %}
{% include 'system/security/source_addresses.j2' %}
{% endwith %}
</security>
</system>
<source-address>
{% for application in nokia_applications %}
<ipv4 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">
<application>{{ application.name }}</application>
<interface-name>{{ application.interface_name }}</interface-name>
</ipv4>
{% endfor %}
</source-address>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment