diff --git a/geant/gap_ansible/roles/base_config/tasks/merge_variables.yaml b/geant/gap_ansible/roles/base_config/tasks/merge_variables.yaml index fd244bc36e7b5b5b376d8ff1148a2e603c5e7130..67f053571a1e027901e8892f9c38eefe96bd94c5 100644 --- a/geant/gap_ansible/roles/base_config/tasks/merge_variables.yaml +++ b/geant/gap_ansible/roles/base_config/tasks/merge_variables.yaml @@ -29,7 +29,7 @@ cpm_filters: "{{ lookup('community.general.merge_variables', 'cpmf__to_merge', pattern_type='suffix') }}" - name: Prepare PE-specific vars - when: verb == "deploy_pe_base_config" + when: router_role == "pe" block: - name: Merge Nokia PE CPM filters ansible.builtin.set_fact: @@ -39,7 +39,17 @@ ansible.builtin.set_fact: cpm_filters: "{{ [cpm_filters, pe_cpm] | community.general.lists_mergeby('family', list_merge='append') }}" + - name: Merge P and PE prefix-lists ansible.builtin.set_fact: - nokia_prefix_lists: "{{ [nokia_prefix_lists, nokia_pe_prefix_lists] | community.general.lists_mergeby('name', + nokia_prefix_lists: "{{ [nokia_prefix_lists, nokia_pe_prefix_lists, nokia_pe_ias_prefix_lists] | community.general.lists_mergeby('name', list_merge='append') }}" + + - name: Merge P and PE source-addresses + ansible.builtin.set_fact: + nokia_applications: "{{ [nokia_applications, nokia_pe_applications] | community.general.lists_mergeby('name', list_merge='append') }}" + + + - name: Select SDP params for l2ciruit-type + ansible.builtin.set_fact: + sdp_type: "{{ (sdp_types | selectattr('id', 'equalto', '1'))[0] }}" diff --git a/geant/gap_ansible/roles/base_config/templates b/geant/gap_ansible/roles/base_config/templates new file mode 120000 index 0000000000000000000000000000000000000000..58acfcf695e82634b9682ed7e351504516814b99 --- /dev/null +++ b/geant/gap_ansible/roles/base_config/templates @@ -0,0 +1 @@ +../bc_templates \ No newline at end of file diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/chassis_tier1.j2 b/geant/gap_ansible/roles/base_config/templates/routers/nokia/chassis_tier1.j2 deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/chassis_tier2.j2 b/geant/gap_ansible/roles/base_config/templates/routers/nokia/chassis_tier2.j2 deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/router/bgp.j2 b/geant/gap_ansible/roles/base_config/templates/routers/nokia/router/bgp.j2 deleted file mode 100644 index d56ae85cdefc6a566d4027b32bc7287dcf3b973d..0000000000000000000000000000000000000000 --- a/geant/gap_ansible/roles/base_config/templates/routers/nokia/router/bgp.j2 +++ /dev/null @@ -1,32 +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"> - <error-handling alu:operation="replace"> - <update-fault-tolerance>true</update-fault-tolerance> - </error-handling> - <local-as alu:operation="replace"> - <as-number>{{ geant_re_as_number }}</as-number> - </local-as> - <group alu:operation="replace"> - <group-name>iGEANT-P-ONLY</group-name> - <admin-state>enable</admin-state> - <next-hop-self>true</next-hop-self> - <type>internal</type> - <peer-as>{{ geant_re_as_number }}</peer-as> - <capability-negotiation>true</capability-negotiation> - <local-address>{{ lo_ipv4_address }}</local-address> - <family> - <mcast-ipv4>true</mcast-ipv4> - </family> - </group> - <group alu:operation="replace"> - <group-name>iGEANT6-P-ONLY</group-name> - <next-hop-self>true</next-hop-self> - <type>internal</type> - <peer-as>{{ geant_re_as_number }}</peer-as> - <capability-negotiation>true</capability-negotiation> - <local-address>{{ lo_ipv6_address }}</local-address> - <family> - <mcast-ipv6>true</mcast-ipv6> - </family> - </group> - {# Here goes the neighbors#} - </bgp> diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/router/static_routes.j2 b/geant/gap_ansible/roles/base_config/templates/routers/nokia/router/static_routes.j2 deleted file mode 100644 index f2d98eae0af654aa3e9816178470521003680a41..0000000000000000000000000000000000000000 --- a/geant/gap_ansible/roles/base_config/templates/routers/nokia/router/static_routes.j2 +++ /dev/null @@ -1,23 +0,0 @@ - <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" alu:operation="replace"> - {% for route in nokia_static_routes %} - <route> - <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 %} - </route> - {% endfor %} - </static-routes> - diff --git a/geant/gap_ansible/roles/base_config/vars/main.yml b/geant/gap_ansible/roles/base_config/vars/main.yml index ab70cced0e51dcec43473b814e11dfbaccd06fab..81deab47a7bf70ae361d85efb7c52a8491fece7e 100644 --- a/geant/gap_ansible/roles/base_config/vars/main.yml +++ b/geant/gap_ansible/roles/base_config/vars/main.yml @@ -16,6 +16,8 @@ lt_ipv4_network: "{{ wfo_router.router.router_ias_lt_ipv4_network }}" lt_ipv6_network: "{{ wfo_router.router.router_ias_lt_ipv6_network }}" site_country_code: "{{ wfo_router.router.router_site.site_country_code }}" is_ias_connected: "{{ wfo_router.router.is_ias_connected }}" +router_tier: "{{ wfo_router.router.router_site.site_tier }}" +router_role: "{{ wfo_router.router.router_role }}" mytemplates: template_name: base_config diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/base_config.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/base_config.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/base_config.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/base_config.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/chassis.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/chassis.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/chassis.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/chassis.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/class_of_service.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/class_of_service.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/class_of_service.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/class_of_service.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/firewall.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/firewall.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/firewall.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/firewall.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/forwarding_options.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/forwarding_options.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/forwarding_options.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/forwarding_options.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/groups.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/groups.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/groups.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/groups.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/interfaces.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/interfaces.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/interfaces.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/interfaces.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/policy_options.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/policy_options.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/policy_options.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/policy_options.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/policy_statements.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/policy_statements.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/policy_statements.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/policy_statements.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/bgp.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/bgp.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/bgp.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/bgp.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/global_msdp.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/global_msdp.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/global_msdp.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/global_msdp.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/igmp.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/igmp.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/igmp.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/igmp.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/internal_msdp.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/internal_msdp.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/internal_msdp.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/internal_msdp.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/isis.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/isis.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/isis.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/isis.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/ldp.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/ldp.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/ldp.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/ldp.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/lldp.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/lldp.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/lldp.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/lldp.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/mld.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/mld.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/mld.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/mld.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/mpls.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/mpls.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/mpls.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/mpls.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/neighbor-discovery.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/neighbor-discovery.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/neighbor-discovery.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/neighbor-discovery.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/pim.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/pim.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/pim.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/pim.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/protocols_global.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/protocols_global.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/protocols_global.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/protocols_global.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/rsvp.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/rsvp.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/protocols/rsvp.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/protocols/rsvp.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/routing_instances.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/routing_instances.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/routing_instances.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/routing_instances.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/routing_options.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/routing_options.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/routing_options.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/routing_options.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/services.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/services.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/services.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/services.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/snmp.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/snmp.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/snmp.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/snmp.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/system/general.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/system/general.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/system/general.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/system/general.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/system/login.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/system/login.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/system/login.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/system/login.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/system/ntp.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/system/ntp.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/system/ntp.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/system/ntp.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/system/radius-server.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/system/radius-server.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/system/radius-server.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/system/radius-server.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/system/services.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/system/services.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/system/services.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/system/services.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/system/syslog.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/system/syslog.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/system/syslog.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/system/syslog.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/juniper/system/system_global.j2 b/geant/gap_ansible/roles/bc_templates/routers/juniper/system/system_global.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/juniper/system/system_global.j2 rename to geant/gap_ansible/roles/bc_templates/routers/juniper/system/system_global.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/base_config.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/base_config.j2 similarity index 67% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/base_config.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/base_config.j2 index bb04f77de11c0ca151e8cd1a52530176cb685a11..a3fc0e26751b51c1a8a1464875375d97634df457 100644 --- a/geant/gap_ansible/roles/base_config/templates/routers/nokia/base_config.j2 +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/base_config.j2 @@ -7,10 +7,18 @@ {% include 'cards.j2' %} {% include 'connectors.j2' %} {% include 'ntp.j2' %} - {% include 'ip_prefix_list.j2' %} {% include 'filters/cpm_filters.j2' %} {% include 'syslog/syslog.j2' %} {% include 'system/security/security.j2' %} {% include 'qos/qos.j2' %} + {% if router_role == 'pe' %} + {% include 'cflowd.j2' %} + {% include 'filter_log.j2' %} + {% include 'policy_options/policy_options.j2' %} + {% include 'service_vprn.j2' %} + {% endif %} + {# This is because `ip_prefix_list` is related to what defined in VPRN apply_paths #} + {% include 'ip_prefix_list.j2' %} + </configure> </config> diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/cards.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/cards.j2 similarity index 80% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/cards.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/cards.j2 index 8540c0335cbfc09325518dae38c6b2aa45178f24..1754c9fb0a9498dd70a116553d28efd8fa65617d 100644 --- a/geant/gap_ansible/roles/base_config/templates/routers/nokia/cards.j2 +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/cards.j2 @@ -1,4 +1,9 @@ - {% for card in nokia_cards %} +{% if router_tier == '3' %} + {% set cards=nokia_cards.sr2se %} +{% else %} + {% set cards=nokia_cards.sr7 %} +{% endif %} + {% for card in cards %} <card 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"> <slot-number>{{ card.slot }}</slot-number> <admin-state>enable</admin-state> diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/cflowd.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/cflowd.j2 new file mode 100644 index 0000000000000000000000000000000000000000..ef8dcc9feaa4c0f5bb8e225f3e5e546dc432b375 --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/cflowd.j2 @@ -0,0 +1,29 @@ +<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> + diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/chassis.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/chassis.j2 similarity index 60% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/chassis.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/chassis.j2 index b0fc6782c861632effd35ed538322674a6a6aee6..da1785f58f5603785a28271903ef13857061a159 100644 --- a/geant/gap_ansible/roles/base_config/templates/routers/nokia/chassis.j2 +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/chassis.j2 @@ -1,17 +1,24 @@ +{% if router_tier == '3' %} + {% set nch=nokia_chassis.sr2se.chassis %} + {% set npsl=nokia_chassis.sr2se.power_safety_level %} +{% else %} + {% set nch=nokia_chassis.sr7.chassis %} + {% set npsl=nokia_chassis.sr7.power_safety_level %} +{% endif %} <chassis 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"> <chassis-class>router</chassis-class> - {% for chassis in nokia_chassis %} - <chassis-number>{{chassis.chassis_id}}</chassis-number> + {% for chassis in nch %} + <chassis-number>{{ chassis.chassis_id }}</chassis-number> {% for power_shelf in chassis.power_shelves %} <power-shelf> - <power-shelf-id>{{ power_shelf.shelf_id}}</power-shelf-id> + <power-shelf-id>{{ power_shelf.shelf_id }}</power-shelf-id> <admin-state>enable</admin-state> <power-shelf-type>{{ power_shelf.shelf_type }}</power-shelf-type> {% for power_module in power_shelf.power_modules %} <power-module> - <power-module-id>{{power_module.power_module_id}}</power-module-id> + <power-module-id>{{ power_module.power_module_id }}</power-module-id> <admin-state>enable</admin-state> - <power-module-type>{{power_module.power_module_type}}</power-module-type> + <power-module-type>{{ power_module.power_module_type }}</power-module-type> </power-module> {% endfor %} </power-shelf> @@ -22,6 +29,6 @@ <power-management 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"> <power-zone>1</power-zone> <mode>none</mode> - <power-safety-level>{{ nokia_power_safety_level }}</power-safety-level> + <power-safety-level>{{ npsl }}</power-safety-level> </power-management> </system> diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/connectors.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/connectors.j2 similarity index 68% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/connectors.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/connectors.j2 index 6c87e50bad725644d28ca7e58756a2d38f27a99a..0d67390f9790eb85215381603ea0a81ca1e5bb94 100644 --- a/geant/gap_ansible/roles/base_config/templates/routers/nokia/connectors.j2 +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/connectors.j2 @@ -1,4 +1,9 @@ - {% for connector in nokia_xma2_connectors %} +{% if router_tier == '3' %} + {% set connectors=nokia_xma2_connectors.sr2se %} +{% else %} + {% set connectors=nokia_xma2_connectors.sr7 %} +{% endif %} + {% for connector in connectors %} <port 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"> <port-id>{{ connector.port_id }}</port-id> <admin-state>enable</admin-state> diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/filter_log.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/filter_log.j2 new file mode 100644 index 0000000000000000000000000000000000000000..7ab3675a89a19a00aa2ff97342c90e8969fa8e11 --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/filter_log.j2 @@ -0,0 +1,18 @@ + +<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> diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/filters/cpm_filters.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/filters/cpm_filters.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/filters/cpm_filters.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/filters/cpm_filters.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/filters/fw_filters.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/filters/fw_filters.j2 similarity index 99% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/filters/fw_filters.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/filters/fw_filters.j2 index 410f156b2359fb8bd3ce701b65e94689ff90d529..4b804948c8cd8419f5c45cbe29e2be24986b861d 100644 --- a/geant/gap_ansible/roles/base_config/templates/routers/nokia/filters/fw_filters.j2 +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/filters/fw_filters.j2 @@ -109,7 +109,7 @@ {% endif %} {% endif %} {# Case when only need to match on protocol, e.g. PIM #} - {% if term.from.protocol is defined and term.from.protocol == '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> @@ -221,7 +221,7 @@ <next-header>{{ term.from.protocol }}</next-header> {% endif %} {% endif %} - {% include 'port_list_entries.j2' %} + {% 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> diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/filters/gen_filters.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/filters/gen_filters.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/filters/gen_filters.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/filters/gen_filters.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/filters/port_list_definitions.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/filters/port_list_definitions.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/filters/port_list_definitions.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/filters/port_list_definitions.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/filters/port_list_entries.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/filters/port_list_entries.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/filters/port_list_entries.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/filters/port_list_entries.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/general.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/general.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/general.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/general.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/ip_prefix_list.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/ip_prefix_list.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/ip_prefix_list.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/ip_prefix_list.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/ntp.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/ntp.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/ntp.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/ntp.j2 diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/policy_options/as_paths.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/policy_options/as_paths.j2 new file mode 100644 index 0000000000000000000000000000000000000000..fadb9c5b01a5b69c57cd13877f0c9b4d86dea62a --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/policy_options/as_paths.j2 @@ -0,0 +1,6 @@ + {% 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 %} diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/policy_options/communities.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/policy_options/communities.j2 new file mode 100644 index 0000000000000000000000000000000000000000..631ddacf38c264784038e969961227f8a09f186c --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/policy_options/communities.j2 @@ -0,0 +1,8 @@ + {% for community in communities_obj %} + <community alu:operation="replace"> + <name>{{ community.name }}</name> + <member> + <member>{{ community.member }}</member> + </member> + </community> + {% endfor %} diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/policy_options/policy_options.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/policy_options/policy_options.j2 new file mode 100644 index 0000000000000000000000000000000000000000..bb4790c644b63d38021a989f56870478946505b2 --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/policy_options/policy_options.j2 @@ -0,0 +1,30 @@ + <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> + diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/policy_options/policy_statements.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/policy_options/policy_statements.j2 new file mode 100644 index 0000000000000000000000000000000000000000..95126f78838203c9bce99458cee179a0a87f5f75 --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/policy_options/policy_statements.j2 @@ -0,0 +1,66 @@ + {% 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 %} diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/policy_options/prefix_lists.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/policy_options/prefix_lists.j2 new file mode 100644 index 0000000000000000000000000000000000000000..507986e60983c0445d2110328584695d67b2b70a --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/policy_options/prefix_lists.j2 @@ -0,0 +1,15 @@ + {% 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 %} diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/qos/qos.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/qos/qos.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/qos/qos.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/qos/qos.j2 diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/router/base_static_routes.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/base_static_routes.j2 new file mode 100644 index 0000000000000000000000000000000000000000..3fc1919ea6b5275211dda574a0b7eb4bb73d8cb8 --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/base_static_routes.j2 @@ -0,0 +1,10 @@ + {% if router_role == 'pe' %} + {% with static_routes_obj=nokia_pe_static_routes %} + {% include 'router/static_routes.j2' %} + {% endwith %} + {% else %} + {% with static_routes_obj=nokia_p_static_routes %} + {% include 'router/static_routes.j2' %} + {% endwith %} + {% endif %} + diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/router/bgp.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/bgp.j2 new file mode 100644 index 0000000000000000000000000000000000000000..cf0811e51d32cda103612fe9a97aac280b29c7f4 --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/bgp.j2 @@ -0,0 +1,21 @@ + <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' %} + {% with bgp_base_obj=pe_bgp_base, bgp_context='bgp_base' %} + {% include 'router/bgp_base.j2' %} + {% endwith %} + {% with bgp_obj=pe_bgp_tools, bgp_group_context='bgp_base' %} + {% include "router/bgp_group.j2" %} + {% include "router/bgp_neighbor.j2" %} + {% endwith %} + {% with bgp_obj=pe_bgp_internal, bgp_group_context='bgp_base' %} + {% include "router/bgp_group.j2" %} + {% endwith %} +{% else %} + {% with bgp_base_obj=p_bgp_base, bgp_obj=p_bgp_internal, bgp_context='bgp_base', + bgp_group_context='bgp_base' %} + {% include 'router/bgp_base.j2' %} + {% include 'router/bgp_group.j2' %} + {% endwith %} +{% endif %} + </bgp> + diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/router/bgp_base.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/bgp_base.j2 new file mode 100644 index 0000000000000000000000000000000000000000..791298633cbf4c9e028cd7c4c2f5327c1ee45545 --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/bgp_base.j2 @@ -0,0 +1,60 @@ + {% if bgp_context == 'vprn' %} + {% if bgp_base_obj.families is defined %} + <family> + {% for fam in bgp_base_obj.families %} + <{{ fam }}>true</{{ fam }}> + {% endfor %} + </family> + {% 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> + {% if nhr.resolution_filter is defined %} + <resolution>filter</resolution> + <resolution-filter> + <{{ nhr.resolution_filter }}>true</{{ nhr.resolution_filter }}> + </resolution-filter> + {% endif %} + </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 %} diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/router/bgp_group.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/bgp_group.j2 new file mode 100644 index 0000000000000000000000000000000000000000..78e3216af26cd17110785252e70d8940dd213eca --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/bgp_group.j2 @@ -0,0 +1,84 @@ + {% 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 %} diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/router/bgp_neighbor.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/bgp_neighbor.j2 new file mode 100644 index 0000000000000000000000000000000000000000..837bc54a4f4ed3c5e5602b4ab5b34a1f7401e4ec --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/bgp_neighbor.j2 @@ -0,0 +1,46 @@ + {% 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 %} + diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/router/delete_default_static_routes.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/delete_default_static_routes.j2 new file mode 100644 index 0000000000000000000000000000000000000000..e14eb22857e7c0956882be488dbef6b1654c4c5e --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/delete_default_static_routes.j2 @@ -0,0 +1,15 @@ +<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_p_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> diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/router/flowspec.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/flowspec.j2 new file mode 100644 index 0000000000000000000000000000000000000000..e1f40f15591b33f7c89caf5c99ceac6783e1c172 --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/flowspec.j2 @@ -0,0 +1,6 @@ + + <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> + diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/router/isis.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/isis.j2 similarity index 87% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/router/isis.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/router/isis.j2 index ca49ef81153f6924931fe1a7e217962dca596187..9ea51d2e313c69e593a60a41abe5d7ae251dc7f9 100644 --- a/geant/gap_ansible/roles/base_config/templates/routers/nokia/router/isis.j2 +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/isis.j2 @@ -16,10 +16,6 @@ <timeout>300</timeout> </overload-on-boot> <loopfree-alternate> - {# <remote-lfa> #} - {# <node-protect> #} - {# </node-protect> #} - {# </remote-lfa> #} <ti-lfa> <node-protect> </node-protect> @@ -38,10 +34,10 @@ <admin-state>enable</admin-state> <passive>true</passive> <ipv4-node-sid> - <index>4{{ last_octet_filled }}</index> + <index>4{{ last_octet_filled }}</index> </ipv4-node-sid> <ipv6-node-sid> - <index>6{{ last_octet_filled }}</index> + <index>6{{ last_octet_filled }}</index> </ipv6-node-sid> </interface> <level> diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/router/isis_overload.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/isis_overload.j2 new file mode 100644 index 0000000000000000000000000000000000000000..c8d177abbfd4d3d0ab9fac1493535533e03fb2af --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/isis_overload.j2 @@ -0,0 +1,18 @@ +<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> diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/router/ldp.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/ldp.j2 new file mode 100644 index 0000000000000000000000000000000000000000..8a312b716654e67525ec4dfde5448d33e2d3fa24 --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/ldp.j2 @@ -0,0 +1,7 @@ + <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> + diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/router/p_to_pe_router_base.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/p_to_pe_router_base.j2 new file mode 100644 index 0000000000000000000000000000000000000000..621d83484decf181c384af1bf5a02d8b7a79921b --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/p_to_pe_router_base.j2 @@ -0,0 +1,13 @@ + <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> + diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/router/pim.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/pim.j2 similarity index 99% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/router/pim.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/router/pim.j2 index 9846452598fdd7fe7211cc7fee6e04d6fc00aca5..ccf8e8d57cb5a95281b18fc5c36c8b3adcd6255e 100644 --- a/geant/gap_ansible/roles/base_config/templates/routers/nokia/router/pim.j2 +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/pim.j2 @@ -1,3 +1,4 @@ + <pim 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"> <rp> <ipv4> @@ -27,3 +28,4 @@ <interface-name>system</interface-name> </interface> </pim> + diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/router/router_base.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/router_base.j2 similarity index 87% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/router/router_base.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/router/router_base.j2 index 3bc40fc75ff24c68dafb000144c83c9b6da88e1c..9d3c86932a1769be1dcb609deef12e91866c8291 100644 --- a/geant/gap_ansible/roles/base_config/templates/routers/nokia/router/router_base.j2 +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/router_base.j2 @@ -1,6 +1,9 @@ <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> <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 %} + <ecmp>{{ pe_bgp_base.ecmp }}</ecmp> + {% endif %} <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-name>system</interface-name> @@ -38,8 +41,14 @@ <interface-name>system</interface-name> </interface> </rsvp> - {% include 'router/static_routes.j2' %} + {% include 'router/base_static_routes.j2' %} {% include 'router/bgp.j2' %} {% include 'router/isis.j2' %} {% include 'router/pim.j2' %} + {% if router_role == 'pe' %} + {% include 'router/flowspec.j2' %} + {% include 'router/ldp.j2' %} + {% include 'router/rpki.j2' %} + {% endif %} </router> + diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/router/rpki.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/rpki.j2 new file mode 100644 index 0000000000000000000000000000000000000000..ce18ab742af4c1b4b1608f54f8006aaa0327dbf7 --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/rpki.j2 @@ -0,0 +1,13 @@ + <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> + diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/router/static_routes.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/static_routes.j2 new file mode 100644 index 0000000000000000000000000000000000000000..1c1d8f4b68394be625b67cef8261ed0b16278036 --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/static_routes.j2 @@ -0,0 +1,38 @@ + <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> + diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/router/vprn.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/vprn.j2 new file mode 100644 index 0000000000000000000000000000000000000000..ec4648f9730af89e9b27a5278998215b4a881bad --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/vprn.j2 @@ -0,0 +1,50 @@ + {% 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> + {% if vprn.ecmp is defined %} + <ecmp>{{ vprn.ecmp }}</ecmp> + {% endif %} + <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 %} + diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/sdp_mesh.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/sdp_mesh.j2 new file mode 100644 index 0000000000000000000000000000000000000000..4542edbcb10536f7a9dbe870d33fcf54062cabba --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/sdp_mesh.j2 @@ -0,0 +1,20 @@ + <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> + diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/service_vprn.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/service_vprn.j2 new file mode 100644 index 0000000000000000000000000000000000000000..4d8a57d9b55922e0098b0e67e37a81b3d0aeec54 --- /dev/null +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/service_vprn.j2 @@ -0,0 +1,12 @@ + +<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' %}#} + diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/sfm.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/sfm.j2 similarity index 71% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/sfm.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/sfm.j2 index aaee64ddee6b6adb6bf3677141a0aa2ca012fa90..0f6f974823188bc7b7a4a217bbd8097df0e93006 100644 --- a/geant/gap_ansible/roles/base_config/templates/routers/nokia/sfm.j2 +++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/sfm.j2 @@ -1,3 +1,8 @@ +{% if router_tier == '3' %} + {% set nokia_sfms=nokia_chassis.sr2se.sfms %} +{% else %} + {% set nokia_sfms=nokia_chassis.sr7.sfms %} +{% endif %} {% for sfm in nokia_sfms %} <sfm 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"> <sfm-slot>{{ sfm.sfm_id }}</sfm-slot> diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/syslog/log_filter.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/syslog/log_filter.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/syslog/log_filter.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/syslog/log_filter.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/syslog/log_id.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/syslog/log_id.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/syslog/log_id.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/syslog/log_id.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/syslog/syslog.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/syslog/syslog.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/syslog/syslog.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/syslog/syslog.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/system/security/aaa_local_profiles.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/system/security/aaa_local_profiles.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/system/security/aaa_local_profiles.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/system/security/aaa_local_profiles.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/system/security/aaa_radius_auth.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/system/security/aaa_radius_auth.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/system/security/aaa_radius_auth.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/system/security/aaa_radius_auth.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/system/security/dist_cpu_protection.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/system/security/dist_cpu_protection.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/system/security/dist_cpu_protection.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/system/security/dist_cpu_protection.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/system/security/security.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/system/security/security.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/system/security/security.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/system/security/security.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/system/security/snmp.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/system/security/snmp.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/system/security/snmp.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/system/security/snmp.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/system/security/source_addresses.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/system/security/source_addresses.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/system/security/source_addresses.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/system/security/source_addresses.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/system/security/ssh.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/system/security/ssh.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/system/security/ssh.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/system/security/ssh.j2 diff --git a/geant/gap_ansible/roles/base_config/templates/routers/nokia/system/security/user_params.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/system/security/user_params.j2 similarity index 100% rename from geant/gap_ansible/roles/base_config/templates/routers/nokia/system/security/user_params.j2 rename to geant/gap_ansible/roles/bc_templates/routers/nokia/system/security/user_params.j2 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..965c97b04b538bae743600c6fae9a6a095daedc1 --- /dev/null +++ b/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/router/bgp_base.j2 @@ -0,0 +1,55 @@ + {% 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 %} 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 %}