From 72699e009dd6b3de3a733471092452cd67dcafe3 Mon Sep 17 00:00:00 2001 From: Aleksandr Kurbatov <ak@geant.org> Date: Wed, 8 Jan 2025 10:32:30 +0000 Subject: [PATCH 1/9] cleanup --- geant/gap_ansible/playbooks/vrf_update.yaml | 4 ++-- geant/gap_ansible/roles/fw_filters/tasks/merge_variables.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/geant/gap_ansible/playbooks/vrf_update.yaml b/geant/gap_ansible/playbooks/vrf_update.yaml index 99abbd3d..37345422 100644 --- a/geant/gap_ansible/playbooks/vrf_update.yaml +++ b/geant/gap_ansible/playbooks/vrf_update.yaml @@ -22,9 +22,9 @@ ansible.builtin.include_vars: dir: /opt/ansible_inventory/group_vars/all - - name: Import standard variables for "{{ subscription.product.product_type }}/{{ subscription.vrf.vrf_name | upper }}" + - name: Import standard variables for "{{ subscription.product.product_type }}/{{ subscription.l3_core_service_type | upper }}" ansible.builtin.include_vars: - dir: /opt/ansible_inventory/geant_services/{{ subscription.product.product_type }}/{{ subscription.vrf.vrf_name | upper }} + dir: /opt/ansible_inventory/geant_services/{{ subscription.product.product_type }}/{{ subscription.l3_core_service_type | upper }} - name: Compile IP prefix lists ansible.builtin.include_role: diff --git a/geant/gap_ansible/roles/fw_filters/tasks/merge_variables.yaml b/geant/gap_ansible/roles/fw_filters/tasks/merge_variables.yaml index e332f512..121d0619 100644 --- a/geant/gap_ansible/roles/fw_filters/tasks/merge_variables.yaml +++ b/geant/gap_ansible/roles/fw_filters/tasks/merge_variables.yaml @@ -4,7 +4,7 @@ when: >- subscription.product.product_type == "L3CoreService" and - subscription.l3_core_service_type == "GÉANT IP" + subscription.l3_core_service_type in ["GÉANT IP", "GEANT IP", "GEANT_IP"] and ap.sbp.custom_firewall_filters | ansible.builtin.bool block: @@ -21,7 +21,7 @@ when: >- subscription.product.product_type == "L3CoreService" and - subscription.l3_core_service_type == "GÉANT IP" + subscription.l3_core_service_type in ["GÉANT IP", "GEANT IP", "GEANT_IP"] and not ap.sbp.custom_firewall_filters | ansible.builtin.bool block: -- GitLab From 4a9d42200dee371445621ee15c100799fc0806b4 Mon Sep 17 00:00:00 2001 From: Aleksandr Kurbatov <ak@geant.org> Date: Tue, 14 Jan 2025 19:38:52 +0000 Subject: [PATCH 2/9] Updated `vrf_update` and `l3_core_service` playbooks --- .../playbooks/l3_core_service.yaml | 52 ++++++------------- geant/gap_ansible/playbooks/vrf_update.yaml | 8 +-- 2 files changed, 17 insertions(+), 43 deletions(-) diff --git a/geant/gap_ansible/playbooks/l3_core_service.yaml b/geant/gap_ansible/playbooks/l3_core_service.yaml index 2223bb6c..67139f81 100644 --- a/geant/gap_ansible/playbooks/l3_core_service.yaml +++ b/geant/gap_ansible/playbooks/l3_core_service.yaml @@ -3,13 +3,16 @@ gather_facts: false tasks: - name: Check SBP + # FIX: rewrite when: verb == 'check' - ansible.builtin.include_role: - name: service_checks - loop: - "{{ subscription.l3_core_service.ap_list }}" - loop_control: - loop_var: ap + ansible.builtin.meta: end_play + + # ansible.builtin.include_role: + # name: service_checks + # loop: + # "{{ subscription.l3_core_service.ap_list }}" + # loop_control: + # loop_var: ap # - name: Check BGP # # FIX: rewrite @@ -42,10 +45,13 @@ ansible.builtin.include_vars: dir: /opt/ansible_inventory/geant_services/{{ subscription.product.product_type }}/{{ subscription.l3_core_service_type | replace(' ', '_') }} - - name: Import partner specific variables for "{{ partner_name | upper }}" + - name: Import {{ partner_name | upper }} general variables ansible.builtin.include_vars: - dir: /opt/ansible_inventory/geant_partners/{{ partner_name | upper }} + file: /opt/ansible_inventory/geant_partners/{{ partner_name | upper }}/general.yaml + - name: Import {{ partner_name | upper }} specific variables for {{ subscription.l3_core_service_type | replace(' ', '_') }} + ansible.builtin.include_vars: + dir: /opt/ansible_inventory/geant_partners/{{ partner_name | upper }}/{{ subscription.l3_core_service_type | replace(' ', '_') }} - name: Compile SBP-related config when: object == 'sbp' @@ -66,20 +72,11 @@ loop_control: loop_var: ap - # - name: Compile SBP config - # block: - # - name: Include SBP role - # ansible.builtin.include_role: - # name: sbp - # loop: - # "{{ subscription.l3_core_service.ap_list }}" - # loop_control: - # loop_var: ap - # - name: Compile BGP-related config when: object == "bgp" block: - name: Include Prefix-list role + when: subscription.l3_core_service_type in ["GÉANT IP", "GEANT IP", "GEANT_IP"] ansible.builtin.include_role: name: po_prefix_lists loop: @@ -103,25 +100,6 @@ loop_control: loop_var: ap - # - name: Compile BGP policies - # block: - # - name: Include BGP policies - # ansible.builtin.include_role: - # name: policy_options - # loop: - # "{{ subscription.l3_core_service.ap_list }}" - # loop_control: - # loop_var: ap - # - # - name: Compile BGP sesssions config - # block: - # - name: Include BGP session - # ansible.builtin.include_role: - # name: bgp_config - # loop: - # "{{ subscription.l3_core_service.ap_list }}" - # loop_control: - # loop_var: ap - name: Deploy # when: verb == deploy diff --git a/geant/gap_ansible/playbooks/vrf_update.yaml b/geant/gap_ansible/playbooks/vrf_update.yaml index 37345422..17f26833 100644 --- a/geant/gap_ansible/playbooks/vrf_update.yaml +++ b/geant/gap_ansible/playbooks/vrf_update.yaml @@ -22,9 +22,9 @@ ansible.builtin.include_vars: dir: /opt/ansible_inventory/group_vars/all - - name: Import standard variables for "{{ subscription.product.product_type }}/{{ subscription.l3_core_service_type | upper }}" + - name: Import standard variables for "{{ subscription.product.product_type }}/{{ subscription.vrf.vrf_name | upper }}" ansible.builtin.include_vars: - dir: /opt/ansible_inventory/geant_services/{{ subscription.product.product_type }}/{{ subscription.l3_core_service_type | upper }} + dir: /opt/ansible_inventory/geant_services/{{ subscription.product.product_type }}/{{ subscription.vrf.vrf_name | upper }} - name: Compile IP prefix lists ansible.builtin.include_role: @@ -41,7 +41,3 @@ - name: Assemble and deploy generated config ansible.builtin.include_role: name: deploy_service_config - loop: - "{{ subscription.vrf.vrf_router_list }}" - loop_control: - loop_var: router -- GitLab From 6c3d5c1a7caf0da98c9366b2f1a2b148d4104b0c Mon Sep 17 00:00:00 2001 From: Aleksandr Kurbatov <ak@geant.org> Date: Tue, 14 Jan 2025 19:39:46 +0000 Subject: [PATCH 3/9] Update `bgp_config` role for LHCONE access --- .../roles/bgp_config/tasks/main.yml | 12 ++++++++ .../roles/bgp_config/tasks/merge_vars.yaml | 30 ++++++++++++++++++- .../roles/bgp_config/templates/bgp.j2 | 14 +++++++-- 3 files changed, 52 insertions(+), 4 deletions(-) diff --git a/geant/gap_ansible/roles/bgp_config/tasks/main.yml b/geant/gap_ansible/roles/bgp_config/tasks/main.yml index 13eca9ef..7bf1d663 100644 --- a/geant/gap_ansible/roles/bgp_config/tasks/main.yml +++ b/geant/gap_ansible/roles/bgp_config/tasks/main.yml @@ -1,5 +1,17 @@ --- # tasks file for bgp_config +- name: Set BGP V4 session object to check for custom policies + ansible.builtin.set_fact: + bgp_session_v4: "{{ ap.sbp | json_query(query) }}" + vars: + query: "bgp_session_list[?ip_type == 'ipv4'] | [0]" + +- name: Set BGP V6 session object to check for custom policies + ansible.builtin.set_fact: + bgp_session_v6: "{{ ap.sbp | json_query(query) }}" + vars: + query: "bgp_session_list[?ip_type == 'ipv6'] | [0]" + - name: Load Standard Policy Statements vars ansible.builtin.include_tasks: merge_vars.yaml diff --git a/geant/gap_ansible/roles/bgp_config/tasks/merge_vars.yaml b/geant/gap_ansible/roles/bgp_config/tasks/merge_vars.yaml index 77676232..a29606a9 100644 --- a/geant/gap_ansible/roles/bgp_config/tasks/merge_vars.yaml +++ b/geant/gap_ansible/roles/bgp_config/tasks/merge_vars.yaml @@ -1,7 +1,35 @@ --- -- name: Set Standard Import and export policies names +- name: Set Standard BGP import and export policy names for GEANT_IP + when: > + subscription.l3_core_service_type in ["GEANT_IP", "GEANT IP"] ansible.builtin.set_fact: import_policies_v4: "{{ bgp.policies.import.v4 }}" import_policies_v6: "{{ bgp.policies.import.v6 }}" export_policies_v4: "{{ bgp.policies.export.v4 }}" export_policies_v6: "{{ bgp.policies.export.v6 }}" + +- name: Set standard BGP import and export policy names for LHCONE + when: > + subscription.l3_core_service_type in ["LHCONE"] + and + not bgp_session_v4.has_custom_policies | ansible.builtin.bool + or + not bgp_session_v4.has_custom_policies | ansible.builtin.bool + ansible.builtin.set_fact: + import_policies_v4: "{{ bgp.policies.import.v4 }}" + import_policies_v6: "{{ bgp.policies.import.v6 }}" + export_policies_v4: "{{ bgp.policies.export.v4 }}" + export_policies_v6: "{{ bgp.policies.export.v6 }}" + +- name: Set custom BGP import and export policy names for LHCONE + when: > + subscription.l3_core_service_type in ["LHCONE"] + and + bgp_session_v4.has_custom_policies | ansible.builtin.bool + or + bgp_session_v4.has_custom_policies | ansible.builtin.bool + ansible.builtin.set_fact: + import_policies_v4: "{{ bgp_custom.policies.import.v4 }}" + import_policies_v6: "{{ bgp_custom.policies.import.v6 }}" + export_policies_v4: "{{ bgp_custom.policies.export.v4 }}" + export_policies_v6: "{{ bgp_custom.policies.export.v6 }}" diff --git a/geant/gap_ansible/roles/bgp_config/templates/bgp.j2 b/geant/gap_ansible/roles/bgp_config/templates/bgp.j2 index 47b82cfb..1ff02609 100644 --- a/geant/gap_ansible/roles/bgp_config/templates/bgp.j2 +++ b/geant/gap_ansible/roles/bgp_config/templates/bgp.j2 @@ -1,9 +1,17 @@ - + {% if subscription.l3_core_service_type in ['GEANT_IP', 'GEANT IP'] %} <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> <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"> {% include 'bgp_neighbor.j2' %} </bgp> - </router> - + {% elif subscription.l3_core_service_type in ['LHCONE'] %} + <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"> + <vprn 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"> + <service-name>{{ vprn_name }}</service-name> + <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"> + {% include 'bgp_neighbor.j2' %} + </bgp> + </vprn> + </service> + {% endif %} -- GitLab From 6266a19bd6835fa8ae9f3fd34e3dc19b85de0964 Mon Sep 17 00:00:00 2001 From: Aleksandr Kurbatov <ak@geant.org> Date: Tue, 14 Jan 2025 19:40:19 +0000 Subject: [PATCH 4/9] Update `deploy_service_config` role for LHCONE access --- .../roles/deploy_service_config/tasks/main.yml | 15 ++++++++++++++- .../roles/deploy_service_config/vars/main.yml | 6 +++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/geant/gap_ansible/roles/deploy_service_config/tasks/main.yml b/geant/gap_ansible/roles/deploy_service_config/tasks/main.yml index 0330f464..8b109a0e 100644 --- a/geant/gap_ansible/roles/deploy_service_config/tasks/main.yml +++ b/geant/gap_ansible/roles/deploy_service_config/tasks/main.yml @@ -9,7 +9,20 @@ when: subscription.product.product_type == 'L3CoreService' ansible.builtin.set_fact: router: "{{ ap.sbp.edge_port.node }}" - vendor: "{{ router.vendor }}" + vendor: "{{ ap.sbp.edge_port.node.vendor }}" + +- name: Extract current inventory router from "vrf_router_list" + when: subscription.product.product_type == 'VRF' + ansible.builtin.set_fact: + current_router: "{{ vrf_router_list | community.general.json_query(query) }}" + vars: + query: "[?router.router_fqdn == '{{ inventory_hostname }}'] | [0]" + +- name: Set router and vendor for the use with VRF update + when: subscription.product.product_type == 'VRF' + ansible.builtin.set_fact: + router: "{{ current_router.router }}" + vendor: "{{ current_router.router.vendor }}" - name: Assemble the config from fragments in previous roles ansible.builtin.include_tasks: assemble_config.yml diff --git a/geant/gap_ansible/roles/deploy_service_config/vars/main.yml b/geant/gap_ansible/roles/deploy_service_config/vars/main.yml index 5def5f74..60eb6cd4 100644 --- a/geant/gap_ansible/roles/deploy_service_config/vars/main.yml +++ b/geant/gap_ansible/roles/deploy_service_config/vars/main.yml @@ -2,6 +2,6 @@ # vars file for deploy_service_config dry_run: true is_verification_workflow: false - -router: "{{ ap.sbp.edge_port.node }}" -vendor: "{{ router.vendor }}" +# +# router: "{{ ap.sbp.edge_port.node }}" +# vendor: "{{ router.vendor }}" -- GitLab From ba979de9ec376d7ff67eea318e81a16eee44422d Mon Sep 17 00:00:00 2001 From: Aleksandr Kurbatov <ak@geant.org> Date: Tue, 14 Jan 2025 19:40:39 +0000 Subject: [PATCH 5/9] Update `fw_filters` role for LHCONE access --- geant/gap_ansible/roles/fw_filters/tasks/merge_variables.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geant/gap_ansible/roles/fw_filters/tasks/merge_variables.yaml b/geant/gap_ansible/roles/fw_filters/tasks/merge_variables.yaml index 121d0619..a481e7f6 100644 --- a/geant/gap_ansible/roles/fw_filters/tasks/merge_variables.yaml +++ b/geant/gap_ansible/roles/fw_filters/tasks/merge_variables.yaml @@ -21,7 +21,7 @@ when: >- subscription.product.product_type == "L3CoreService" and - subscription.l3_core_service_type in ["GÉANT IP", "GEANT IP", "GEANT_IP"] + subscription.l3_core_service_type in ["GÉANT IP", "GEANT IP", "GEANT_IP", "LHCONE"] and not ap.sbp.custom_firewall_filters | ansible.builtin.bool block: -- GitLab From 303cd690346450b82108c81825d9a1a0937e6222 Mon Sep 17 00:00:00 2001 From: Aleksandr Kurbatov <ak@geant.org> Date: Tue, 14 Jan 2025 19:41:45 +0000 Subject: [PATCH 6/9] Update `policy_options` for LHCONE access --- .../roles/policy_options/tasks/main.yml | 29 ++++++++++++++++++- .../tasks/merge_vrf_custom_vars.yaml | 16 ++++++++++ ...vars.yaml => merge_vrf_standard_vars.yaml} | 4 +++ .../templates/policy_statements.j2 | 5 ++++ 4 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 geant/gap_ansible/roles/policy_options/tasks/merge_vrf_custom_vars.yaml rename geant/gap_ansible/roles/policy_options/tasks/{merge_vrf_vars.yaml => merge_vrf_standard_vars.yaml} (66%) diff --git a/geant/gap_ansible/roles/policy_options/tasks/main.yml b/geant/gap_ansible/roles/policy_options/tasks/main.yml index a896fc3b..4c3793bf 100644 --- a/geant/gap_ansible/roles/policy_options/tasks/main.yml +++ b/geant/gap_ansible/roles/policy_options/tasks/main.yml @@ -1,5 +1,21 @@ --- # tasks file for policy_options +- name: Set BGP V4 session object to check for custom policies + when: > + subscription.product.product_type == "L3CoreService" + ansible.builtin.set_fact: + bgp_session_v4: "{{ ap.sbp | json_query(query) }}" + vars: + query: "bgp_session_list[?ip_type == 'ipv4'] | [0]" + +- name: Set BGP V6 session object to check for custom policies + when: > + subscription.product.product_type == "L3CoreService" + ansible.builtin.set_fact: + bgp_session_v6: "{{ ap.sbp | json_query(query) }}" + vars: + query: "bgp_session_list[?ip_type == 'ipv6'] | [0]" + - name: Load Standard Policy Statements vars when: > subscription.product.product_type == "L3CoreService" @@ -7,10 +23,21 @@ subscription.l3_core_service_type in ["GÉANT IP", "GEANT IP", "GEANT_IP"] ansible.builtin.include_tasks: merge_geant_ip_vars.yaml +- name: Load NREN custom VRF policies + when: > + subscription.product.product_type == "L3CoreService" + and + subscription.l3_core_service_type in ["LHCONE"] + and + (bgp_session_v4.has_custom_policies | ansible.builtin.bool + or + bgp_session_v6.has_custom_policies | ansible.builtin.bool) + ansible.builtin.include_tasks: merge_vrf_custom_vars.yaml + - name: Load Standard Policy Options for VRF {{ subscription.vrf.vrf_name }} when: > subscription.product.product_type == "VRF" - ansible.builtin.include_tasks: merge_vrf_vars.yaml + ansible.builtin.include_tasks: merge_vrf_standard_vars.yaml - name: Compile templates ansible.builtin.include_tasks: compile.yaml diff --git a/geant/gap_ansible/roles/policy_options/tasks/merge_vrf_custom_vars.yaml b/geant/gap_ansible/roles/policy_options/tasks/merge_vrf_custom_vars.yaml new file mode 100644 index 00000000..e223ce3a --- /dev/null +++ b/geant/gap_ansible/roles/policy_options/tasks/merge_vrf_custom_vars.yaml @@ -0,0 +1,16 @@ +--- +- name: Set custom PO vars + # when: > + # bgp_session_v6.has_custom_policies | ansible.builtin.bool + block: + - name: Set NREN custom communities + ansible.builtin.set_fact: + po_final_communities: "{{ lookup('community.general.merge_variables', 'CUSTOM_COMMUNITIES') }}" + + # - name: Set NREN custom AS paths + # ansible.builtin.set_fact: + # po_final_aspath: "{{ lookup('community.general.merge_variables', 'CUSTOM_ASPATH') }}" + + - name: Set NREN custom policies + ansible.builtin.set_fact: + po_final_policies: "{{ lookup('community.general.merge_variables', 'CUSTOM_PO_POL_STATEMENTS') }}" diff --git a/geant/gap_ansible/roles/policy_options/tasks/merge_vrf_vars.yaml b/geant/gap_ansible/roles/policy_options/tasks/merge_vrf_standard_vars.yaml similarity index 66% rename from geant/gap_ansible/roles/policy_options/tasks/merge_vrf_vars.yaml rename to geant/gap_ansible/roles/policy_options/tasks/merge_vrf_standard_vars.yaml index 528a7b45..b832e4e0 100644 --- a/geant/gap_ansible/roles/policy_options/tasks/merge_vrf_vars.yaml +++ b/geant/gap_ansible/roles/policy_options/tasks/merge_vrf_standard_vars.yaml @@ -3,6 +3,10 @@ ansible.builtin.set_fact: po_final_prefix_lists: "{{ lookup('community.general.merge_variables', 'STANDARD_VRF_PO_PREFIX_LISTS') }}" +- name: Load Standard Policy Options prefix lists for VRF {{ subscription.vrf.vrf_name }} + ansible.builtin.set_fact: + po_final_communities: "{{ lookup('community.general.merge_variables', 'STANDARD_VRF_COMMUNITIES') }}" + - name: Load Standard Policy Options policies for VRF {{ subscription.vrf.vrf_name }} ansible.builtin.set_fact: po_final_policies: "{{ lookup('community.general.merge_variables', 'STANDARD_VRF_PO_POLICIES') }}" diff --git a/geant/gap_ansible/roles/policy_options/templates/policy_statements.j2 b/geant/gap_ansible/roles/policy_options/templates/policy_statements.j2 index 32570140..1dd917a6 100644 --- a/geant/gap_ansible/roles/policy_options/templates/policy_statements.j2 +++ b/geant/gap_ansible/roles/policy_options/templates/policy_statements.j2 @@ -57,6 +57,11 @@ <add>{{ community }}</add> </community> {% endfor %} + {% elif act_k == "as_path_prepend" %} + <as-path-prepend> + <as-path>{{ act_v.as_path }}</as-path> + <repeat>{{ act_v.repeat }}</repeat> + </as-path-prepend> {% elif act_k == "bgp_med" %} <bgp-med> <set>{{ act_v | default(bgp.standard_metric.med[ap_type]) }}</set> -- GitLab From 911171d560dc1cb4aa4844cf2af31f9bd5109de7 Mon Sep 17 00:00:00 2001 From: Aleksandr Kurbatov <ak@geant.org> Date: Tue, 14 Jan 2025 19:42:30 +0000 Subject: [PATCH 7/9] Update `sbp` role for LHCONE --- .../roles/sbp/templates/deploy_sbp.j2 | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/geant/gap_ansible/roles/sbp/templates/deploy_sbp.j2 b/geant/gap_ansible/roles/sbp/templates/deploy_sbp.j2 index cda9f6d5..7aa5ef4b 100644 --- a/geant/gap_ansible/roles/sbp/templates/deploy_sbp.j2 +++ b/geant/gap_ansible/roles/sbp/templates/deploy_sbp.j2 @@ -4,11 +4,20 @@ {% endif %} <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"> + {% if subscription.l3_core_service_type in ['GEANT_IP', 'GEANT IP'] %} <ies 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"> - <service-name>{{ ies_re_name }}</service-name> + <service-name>{{ ies_re_name }}</service-name> + {% elif subscription.l3_core_service_type in ['LHCONE'] %} + <vprn 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"> + <service-name>{{ vprn_name }}</service-name> + {% endif %} <interface alu:operation="replace"> <interface-name>{{ lag_name }}.{{ ap.sbp.vlan_id }}</interface-name> + {% if subscription.l3_core_service_type in ['GEANT_IP', 'GEANT IP'] %} <description>SRV_GLOBAL CUSTOMER {{ partner_name }} #{{ partner_name }}-{{ ap.ap_type }} ${{ ap.sbp.gs_id }} | ASN{{ partner.asn }} | </description> + {% elif subscription.l3_core_service_type in ['LHCONE'] %} + <description>SRV_L3VPN CUSTOMER {{ partner_name }} #{{ partner_name }}-{{ ap.ap_type }} ${{ ap.sbp.gs_id }} | ASN{{ partner.asn }} | </description> + {% endif %} <ip-mtu>{{ sbp_params.ip_mtu }}</ip-mtu> <sap> {% if ap.sbp.is_tagged %} @@ -19,14 +28,24 @@ <admin-state>enable</admin-state> <ingress> <filter> + {% if subscription.l3_core_service_type in ['GEANT_IP', 'GEANT IP'] %} <ip>{{ partner_name | upper }}_EDGE_IN</ip> <ipv6>{{ partner_name | upper }}_EDGE_IN_V6</ipv6> + {% elif subscription.l3_core_service_type in ['LHCONE'] %} + <ip>LHCONE_{{ partner_name | upper }}_IN</ip> + <ipv6>LHCONE_{{ partner_name | upper }}_IN_V6</ipv6> + {% endif %} </filter> </ingress> <egress> <filter> + {% if subscription.l3_core_service_type in ['GEANT_IP', 'GEANT IP'] %} <ip>{{ partner_name | upper }}_EDGE_OUT</ip> <ipv6>{{ partner_name | upper }}_EDGE_OUT_V6</ipv6> + {% elif subscription.l3_core_service_type in ['LHCONE'] %} + <ip>LHCONE_{{ partner_name | upper }}_OUT</ip> + <ipv6>LHCONE_{{ partner_name | upper }}_OUT_V6</ipv6> + {% endif %} </filter> </egress> </sap> @@ -83,7 +102,11 @@ </address> </ipv6> </interface> + {% if subscription.l3_core_service_type in ['GEANT_IP', 'GEANT IP'] %} </ies> + {% elif subscription.l3_core_service_type in ['LHCONE'] %} + </vprn> + {% endif %} </service> {% if is_standalone_run %} -- GitLab From fcc10f3eb12add680de422c8e2190e6de4c57d3b Mon Sep 17 00:00:00 2001 From: Aleksandr Kurbatov <ak@geant.org> Date: Tue, 14 Jan 2025 19:42:51 +0000 Subject: [PATCH 8/9] update `service_checks` role --- geant/gap_ansible/roles/service_checks/tasks/main.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/geant/gap_ansible/roles/service_checks/tasks/main.yml b/geant/gap_ansible/roles/service_checks/tasks/main.yml index a6554fdd..848c17d4 100644 --- a/geant/gap_ansible/roles/service_checks/tasks/main.yml +++ b/geant/gap_ansible/roles/service_checks/tasks/main.yml @@ -1,5 +1,14 @@ --- # tasks file for service_checks +- name: Import group_vars/all + ansible.builtin.include_vars: + dir: /opt/ansible_inventory/group_vars/all + +- name: Load netconf connection config + ansible.builtin.set_fact: + ansible_connection: "{{ netconf_access[ap.sbp.edge_port.node.vendor].ansible_connection }}" + ansible_network_os: "{{ netconf_access[ap.sbp.edge_port.node.vendor].ansible_network_os }}" + - name: Ping peer via SBP when: object == 'sbp' ansible.builtin.include_tasks: sbp_checks.yaml -- GitLab From bc4fde004222260dc2b320ae28d18da7fc053c31 Mon Sep 17 00:00:00 2001 From: Aleksandr Kurbatov <ak@geant.org> Date: Tue, 14 Jan 2025 19:43:38 +0000 Subject: [PATCH 9/9] Update `vrf` role VPRN object standard name change: LHCONE_VPRN -> VPRN --- geant/gap_ansible/roles/vrf/templates/service.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geant/gap_ansible/roles/vrf/templates/service.j2 b/geant/gap_ansible/roles/vrf/templates/service.j2 index 66a591cd..63f32b15 100644 --- a/geant/gap_ansible/roles/vrf/templates/service.j2 +++ b/geant/gap_ansible/roles/vrf/templates/service.j2 @@ -1,6 +1,6 @@ <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"> -{% with pe_vprns=LHCONE_VPRN %} +{% with pe_vprns=VPRN %} {% include 'router/vprn.j2' %} {% endwith %} </service> -- GitLab