diff --git a/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/router/base_bgp.j2 b/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/router/base_bgp.j2 deleted file mode 100644 index 0b911be76645cdacaf2ae7e63a50deb93d595ca2..0000000000000000000000000000000000000000 --- a/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/router/base_bgp.j2 +++ /dev/null @@ -1,58 +0,0 @@ - <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 pe_bgp_base.best_path_selection is defined %} - <best-path-selection> - {% for bps in pe_bgp_base.best_path_selection %} - <{{ bps }}>true</{{ bps }}> - {% endfor %} - </best-path-selection> - {% endif %} - {% if pe_bgp_base.error_handling is defined %} - <error-handling> - <{{ pe_bgp_base.error_handling }}>true</{{ pe_bgp_base.error_handling }}> - </error-handling> - {% endif %} - {% if pe_bgp_base.next_hop_resolution.shortcut_tunnel is defined %} - <next-hop-resolution> - <shortcut-tunnel> - {% for nhr in pe_bgp_base.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 pe_bgp_base.multipath is defined %} - <multipath alu:operation="replace"> - {% if pe_bgp_base.multipath.ibgp is defined %} - <ibgp>{{ pe_bgp_base.multipath.ibgp }}</ibgp> - {% endif %} - {% if pe_bgp_base.multipath.ebgp is defined %} - <ebgp>{{ pe_bgp_base.multipath.ebgp }}</ebgp> - {% endif %} - {% if pe_bgp_base.multipath.ipv4 is defined %} - <family> - <family-type>ipv4</family-type> - <max-paths>{{ pe_bgp_base.multipath.ipv4 }}</max-paths> - </family> - {% endif %} - {% if pe_bgp_base.multipath.ipv6 is defined %} - <family> - <family-type>ipv6</family-type> - <max-paths>{{ pe_bgp_base.multipath.ipv6 }}</max-paths> - </family> - {% endif %} - </multipath> - {% endif %} -{% 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> - diff --git a/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/router/bgp.j2 b/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/router/bgp.j2 new file mode 100644 index 0000000000000000000000000000000000000000..b5af67ba3634ac0804b77e59579a719975c886f2 --- /dev/null +++ b/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/router/bgp.j2 @@ -0,0 +1,13 @@ + <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> + diff --git a/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/router/bgp_base.j2 b/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/router/bgp_base.j2 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/router/router_base.j2 b/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/router/router_base.j2 index ce792e856c3f5eb97ac854e2e5870a47f37ce0f0..621d83484decf181c384af1bf5a02d8b7a79921b 100644 --- a/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/router/router_base.j2 +++ b/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/router/router_base.j2 @@ -4,7 +4,7 @@ {% include 'router/static_routes.j2' %} {% endwith %} {% with bgp_group_context='bgp_base' %} - {% include 'router/base_bgp.j2' %} + {% include 'router/bgp.j2' %} {% endwith %} {% include 'router/flowspec.j2' %} {% include 'router/ldp.j2' %} diff --git a/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/router/vprn.j2 b/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/router/vprn.j2 index fa8b93629adf476092c007d3e7fd1ea16289c5a1..23185e594b0c5ecf49b9cd3b1ef5216bbe2237c0 100644 --- a/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/router/vprn.j2 +++ b/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/router/vprn.j2 @@ -24,42 +24,9 @@ </mpls> </bgp-ipvpn> <bgp> - {% if vprn.bgp.families is defined %} - <family> - {% for fam in vprn.bgp.families %} - <{{ fam }}>true</{{ fam }}> - {% endfor %} - </family> - {% endif %} - {% if vprn.bgp.best_path_selection is defined %} - <best-path-selection> - {% for bps in vprn.bgp.best_path_selection %} - <{{ bps }}>true</{{ bps }}> - {% endfor %} - </best-path-selection> - {% endif %} - {% if vprn.bgp.multipath is defined %} - <multipath> - {% if vprn.bgp.multipath.ibgp is defined %} - <ibgp>{{ vprn.bgp.multipath.ibgp }}</ibgp> - {% endif %} - {% if vprn.bgp.multipath.ebgp is defined %} - <ebgp>{{ vprn.bgp.multipath.ebgp }}</ebgp> - {% endif %} - {% if vprn.bgp.multipath.ipv4 is defined %} - <family> - <family-type>ipv4</family-type> - <max-paths>{{ vprn.bgp.multipath.ipv4 }}</max-paths> - </family> - {% endif %} - {% if vprn.bgp.multipath.ipv6 is defined %} - <family> - <family-type>ipv6</family-type> - <max-paths>{{ vprn.bgp.multipath.ipv6 }}</max-paths> - </family> - {% endif %} - </multipath> - {% endif %} + {% 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 %}