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

Merge branch 'feature/nat-1148-l3-reworkO' into 'develop'

Feature/nat 1148 l3 rework o

See merge request !259
parents b23d70e0 d7eb3bb6
Branches
Tags
1 merge request!259Feature/nat 1148 l3 rework o
Pipeline #93673 passed
Showing
with 131 additions and 103 deletions
......@@ -10,7 +10,7 @@
# ansible.builtin.include_role:
# name: service_checks
# loop:
# "{{ subscription.l3_core_service.ap_list }}"
# "{{ subscription.l3_subscription_type.l3_core.ap_list }}"
# loop_control:
# loop_var: ap
......@@ -43,34 +43,42 @@
- name: Import standard general variables for GEANT L3 Core Services
ansible.builtin.include_vars:
file: /opt/ansible_inventory/geant_services/{{ subscription.product.product_type }}/general.yaml
file: /opt/ansible_inventory/geant_services/L3CoreService/general.yaml
- name: Set the L3 subscription key
ansible.builtin.set_fact:
subscription_key: "{{ l3_services[subscription.product.product_type | upper] }}"
- name: Set the AP list var
ansible.builtin.set_fact:
ap_list: "{{ subscription[subscription_key].l3_core.ap_list }}"
- name: Import general variables for {{ partner_name | upper }}
ansible.builtin.include_vars:
file: /opt/ansible_inventory/geant_partners/{{ partner_name | upper }}/general.yaml
- name: Import standard variables for "{{ subscription.product.product_type }}/{{ subscription.l3_core_service_type | replace(' ', '_') }}"
- name: Import standard variables for "L3CoreService/{{ subscription.product.product_type | replace(' ', '_') | upper }}"
ansible.builtin.include_vars:
dir: /opt/ansible_inventory/geant_services/{{ subscription.product.product_type }}/{{ subscription.l3_core_service_type | replace(' ', '_') }}
dir: /opt/ansible_inventory/geant_services/L3CoreService/{{ subscription.product.product_type | replace(' ', '_') | upper }}
- name: Import {{ partner_name | upper }} specific variables for {{ subscription.l3_core_service_type | replace(' ', '_') }}
- name: Import {{ partner_name | upper }} specific variables for {{ subscription.product.product_type | replace(' ', '_') | upper }}
when: >
subscription.l3_core_service.ap_list | selectattr('sbp.custom_firewall_filters', 'eq', true) | list | length > 0
ap_list | selectattr('sbp.custom_firewall_filters', 'eq', true) | list | length > 0
or
subscription.l3_core_service.ap_list | map(attribute='sbp.bgp_session_list') | flatten | selectattr('has_custom_policies', 'eq', true) | list | length > 0
ap_list | map(attribute='sbp.bgp_session_list') | flatten | selectattr('has_custom_policies', 'eq', true) | list | length > 0
ansible.builtin.include_vars:
dir: /opt/ansible_inventory/geant_partners/{{ partner_name | upper }}/{{ subscription.l3_core_service_type | replace(' ', '_') }}
dir: /opt/ansible_inventory/geant_partners/{{ partner_name | upper }}/{{ subscription.product.product_type | replace(' ', '_') }}
- name: Compile SBP-related config
when: object == 'sbp'
block:
- name: Include IP prefix list if Custom FW is selected
when: >
subscription.l3_core_service.ap_list | selectattr('sbp.custom_firewall_filters', 'eq', true) | list | length > 0
ap_list | selectattr('sbp.custom_firewall_filters', 'eq', true) | list | length > 0
ansible.builtin.include_role:
name: ip_prefix_lists
loop:
"{{ subscription.l3_core_service.ap_list }}"
"{{ ap_list }}"
loop_control:
loop_var: ap
......@@ -78,7 +86,7 @@
ansible.builtin.include_role:
name: fw_filters
loop:
"{{ subscription.l3_core_service.ap_list }}"
"{{ ap_list }}"
loop_control:
loop_var: ap
......@@ -86,7 +94,7 @@
ansible.builtin.include_role:
name: sbp
loop:
"{{ subscription.l3_core_service.ap_list }}"
"{{ ap_list }}"
loop_control:
loop_var: ap
......@@ -99,7 +107,7 @@
vars:
qry: "bgp_session_list[?ip_type == 'ipv4'] | [0]"
loop:
"{{ subscription.l3_core_service.ap_list }}"
"{{ ap_list }}"
loop_control:
loop_var: ap
......@@ -109,7 +117,7 @@
vars:
qry: "bgp_session_list[?ip_type == 'ipv6'] | [0]"
loop:
"{{ subscription.l3_core_service.ap_list }}"
"{{ ap_list }}"
loop_control:
loop_var: ap
......@@ -117,20 +125,20 @@
when: >
bgp_session_v4.families is contains('mcast-ipv4') or bgp_session_v6 is contains('mcast-ipv6')
and
subscription.l3_core_service_type in l3_service_types.ies
subscription.product.product_type | upper in l3_service_types.ies
ansible.builtin.include_role:
name: pim
loop:
"{{ subscription.l3_core_service.ap_list }}"
"{{ ap_list }}"
loop_control:
loop_var: ap
- name: Include PO prefix list generation
when: subscription.l3_core_service_type in generate_po_prefix_lists
when: subscription.product.product_type | upper in l3_generate_po_prefix_lists
ansible.builtin.include_role:
name: po_prefix_lists
loop:
"{{ subscription.l3_core_service.ap_list }}"
"{{ ap_list }}"
loop_control:
loop_var: ap
......@@ -138,7 +146,7 @@
ansible.builtin.include_role:
name: policy_options
loop:
"{{ subscription.l3_core_service.ap_list }}"
"{{ ap_list }}"
loop_control:
loop_var: ap
......@@ -146,7 +154,7 @@
ansible.builtin.include_role:
name: bgp_config
loop:
"{{ subscription.l3_core_service.ap_list }}"
"{{ ap_list }}"
loop_control:
loop_var: ap
......@@ -158,6 +166,6 @@
ansible.builtin.include_role:
name: deploy_service_config
loop:
"{{ subscription.l3_core_service.ap_list }}"
"{{ ap_list }}"
loop_control:
loop_var: ap
......@@ -25,20 +25,28 @@
ansible.builtin.include_vars:
file: /opt/ansible_inventory/geant_partners/{{ partner_name | upper }}/general.yaml
- name: Import general variables for {{ subscription.product.product_type }}
- name: Import standard general variables for GEANT L3 Core Services
ansible.builtin.include_vars:
file: /opt/ansible_inventory/geant_services/{{ subscription.product.product_type }}/general.yaml
file: /opt/ansible_inventory/geant_services/L3CoreService/general.yaml
- name: Import BGP specific vars for {{ subscription.l3_core_service_type | replace(' ', '_') }}
- name: Set the L3 subscription key
ansible.builtin.set_fact:
subscription_key: "{{ l3_services[subscription.product.product_type | upper] }}"
- name: Set the AP list var
ansible.builtin.set_fact:
ap_list: "{{ subscription[subscription_key].l3_core.ap_list }}"
- name: Import BGP specific vars for {{ subscription.product.product_type | upper | replace(' ', '_') }}
ansible.builtin.include_vars:
file: /opt/ansible_inventory/geant_services/{{ subscription.product.product_type }}/{{ subscription.l3_core_service_type | replace(' ', '_') }}/bgp.yaml
file: /opt/ansible_inventory/geant_services/L3CoreService/{{ subscription.product.product_type | upper | replace(' ', '_') }}/bgp.yaml
- name: Check BGP neighbors
when: verb == 'check'
ansible.builtin.include_role:
name: service_checks
loop:
"{{ subscription.l3_core_service.ap_list }}"
"{{ ap_list }}"
loop_control:
loop_var: ap
......@@ -48,7 +56,7 @@
ansible.builtin.include_role:
name: bgp_config
loop:
"{{ subscription.l3_core_service.ap_list }}"
"{{ ap_list }}"
loop_control:
loop_var: ap
......@@ -59,6 +67,6 @@
ansible.builtin.include_role:
name: deploy_service_config
loop:
"{{ subscription.l3_core_service.ap_list }}"
"{{ ap_list }}"
loop_control:
loop_var: ap
......@@ -21,20 +21,23 @@
ansible.builtin.include_vars:
dir: /opt/ansible_inventory/group_vars/all
- name: Import general variables for {{ subscription.product.product_type }}
- name: Import standard general variables for GEANT L3 Core Services
ansible.builtin.include_vars:
file: /opt/ansible_inventory/geant_services/{{ subscription.product.product_type }}/general.yaml
file: /opt/ansible_inventory/geant_services/L3CoreService/general.yaml
# - name: Import BGP specific vars for {{ subscription.l3_core_service_type }}
# ansible.builtin.include_vars:
# file: /opt/ansible_inventory/geant_services/{{ subscription.product.product_type }}/{{ subscription.l3_core_service_type }}/bgp.yaml
- name: Set the L3 subscription key
ansible.builtin.set_fact:
subscription_key: "{{ l3_services[subscription.product.product_type | upper] }}"
- name: Set the AP list var
ansible.builtin.set_fact:
ap_list: "{{ subscription[subscription_key].l3_core.ap_list }}"
- name: Deactivate SPB on the old router
ansible.builtin.include_role:
name: sbp
loop:
"{{ subscription.l3_core_service.ap_list }}"
"{{ ap_list }}"
loop_control:
loop_var: ap
......@@ -45,6 +48,6 @@
ansible.builtin.include_role:
name: deploy_service_config
loop:
"{{ subscription.l3_core_service.ap_list }}"
"{{ ap_list }}"
loop_control:
loop_var: ap
......@@ -24,24 +24,32 @@
- name: Import standard general variables for GEANT L3 Core Services
ansible.builtin.include_vars:
file: /opt/ansible_inventory/geant_services/{{ subscription.product.product_type }}/general.yaml
file: /opt/ansible_inventory/geant_services/L3CoreService/general.yaml
- name: Set the L3 subscription key
ansible.builtin.set_fact:
subscription_key: "{{ l3_services[subscription.product.product_type | upper] }}"
- name: Set the AP list var
ansible.builtin.set_fact:
ap_list: "{{ subscription[subscription_key].l3_core.ap_list }}"
- name: Import general variables for {{ partner_name | upper }}
ansible.builtin.include_vars:
file: /opt/ansible_inventory/geant_partners/{{ partner_name | upper }}/general.yaml
- name: Import standard variables for "{{ subscription.product.product_type }}/{{ subscription.l3_core_service_type | replace(' ', '_') }}"
- name: Import standard variables for "L3CoreService/{{ subscription.product.product_type | replace(' ', '_') | upper }}"
ansible.builtin.include_vars:
dir: /opt/ansible_inventory/geant_services/{{ subscription.product.product_type }}/{{ subscription.l3_core_service_type | replace(' ', '_') }}
dir: /opt/ansible_inventory/geant_services/L3CoreService/{{ subscription.product.product_type | replace(' ', '_') | upper }}
- name: Generate PO prefix lists
block:
- name: Include PO prefix list role
when: subscription.l3_core_service_type in generate_po_prefix_lists
when: subscription.product.product_type | upper in l3_generate_po_prefix_lists
ansible.builtin.include_role:
name: po_prefix_lists
loop:
"{{ subscription.l3_core_service.ap_list }}"
"{{ ap_list }}"
loop_control:
loop_var: ap
......@@ -52,6 +60,6 @@
ansible.builtin.include_role:
name: deploy_service_config
loop:
"{{ subscription.l3_core_service.ap_list }}"
"{{ ap_list }}"
loop_control:
loop_var: ap
---
- name: Set Standard BGP import and export policy names for {{ subscription.l3_core_service_type }}
- name: Set Standard BGP import and export policy names for {{ subscription.product.product_type | upper }}
when: >
subscription.l3_core_service_type in l3_service_types.ies
subscription.product.product_type | upper in l3_service_types.ies
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 VPRN {{ subscription.l3_core_service_type }}
- name: Set standard BGP import and export policy names for VPRN {{ subscription.product.product_type | upper }}
when: >
subscription.l3_core_service_type in l3_service_types.vprn
subscription.product.product_type | upper in l3_service_types.vprn
and
not bgp_session_v4.has_custom_policies | ansible.builtin.bool
or
......@@ -23,7 +23,7 @@
- name: Set custom BGP import and export policy names for VPRN
when: >
subscription.l3_core_service_type in l3_service_types.vprn
subscription.product.product_type | upper in l3_service_types.vprn
and
bgp_session_v4.has_custom_policies | ansible.builtin.bool
or
......
{% for neighbor in bgp_obj %}
{% if subscription.l3_core_service_type in l3_service_types.ies %}
{% if subscription.product.product_type | upper in l3_service_types.ies %}
{% if neighbor.ip_type == 'ipv4' %}
deactivate protocols bgp group {{ bgp.group.ipv4_juniper }} neighbor {{ neighbor.peer_address }}
{% elif neighbor.ip_type == 'ipv6' %}
deactivate protocols bgp group {{ bgp.group.ipv6_juniper }} neighbor {{ neighbor.peer_address }}
{% endif %}
{% elif subscription.l3_core_service_type in l3_service_types.vprn %}
{% elif subscription.product.product_type | upper in l3_service_types.vprn %}
{% if neighbor.ip_type == 'ipv4' %}
deactivate routing-instances {{ bgp.routing_instance_juniper }} protocols bgp group {{ bgp.group.ipv4_juniper }} neighbor {{ neighbor.peer_address }}
{% elif neighbor.ip_type == 'ipv6' %}
......
{% if subscription.l3_core_service_type in l3_service_types.ies %}
{% if subscription.product.product_type | upper in l3_service_types.ies %}
<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 l3_service_types.vprn %}
{% elif subscription.product.product_type | upper in l3_service_types.vprn %}
<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>
......
......@@ -6,11 +6,15 @@
# However, mixing "imports" with "includes" is not recommended.
# Another way is to "apply" the "delegate_to: localhost".
- name: Set router and vendor for the use with SBP
when: subscription.product.product_type == 'L3CoreService'
when: >
subscription.product.product_type | upper in l3_services.keys() | list
# when: subscription.product.product_type | upper in l3_service_types.ies
# or subscription.product.product_type | upper in l3_service_types.vprn
ansible.builtin.set_fact:
router: "{{ ap.sbp.edge_port.node }}"
vendor: "{{ ap.sbp.edge_port.node.vendor }}"
# TODO: check product_type VRF
- name: Extract current inventory router from "vrf_router_list"
when: subscription.product.product_type == 'VRF'
ansible.builtin.set_fact:
......
......@@ -24,7 +24,7 @@
subscription.product.product_type == 'L3CoreService'
ansible.builtin.fail:
msg: >
The config of {{ object }} in {{ subscription.l3_core_service_type }}
The config of {{ object }} in {{ subscription.product.product_type | upper }}
for {{ partner_name | upper }} drifted!
- name: Fail if there is any diff - Any product
......
......@@ -5,7 +5,7 @@
# when: >-
# subscription.product.product_type == "L3CoreService"
# and
# subscription.l3_core_service_type in l3_service_types.ies or subscription.l3_core_service_type in l3_service_types.vprn
# subscription.product.product_type | upper in l3_service_types.ies or subscription.product.product_type | upper in l3_service_types.vprn
# and
# ap.sbp.custom_firewall_filters | ansible.builtin.bool
block:
......@@ -13,7 +13,7 @@
when: >
ap.sbp.custom_firewall_filters | ansible.builtin.bool
and
subscription.l3_core_service_type in l3_service_types.ies
subscription.product.product_type | upper in l3_service_types.ies
ansible.builtin.set_fact:
custom_edge_fw: "{{ [STANDARD_NREN_FW__to_merge, CUSTOM_NREN_FW] | community.general.lists_mergeby('name',
recursive=true, list_merge='append') }}"
......@@ -22,7 +22,7 @@
when: >
ap.sbp.custom_firewall_filters | ansible.builtin.bool
and
subscription.l3_core_service_type in l3_service_types.ies
subscription.product.product_type | upper in l3_service_types.ies
ansible.builtin.set_fact:
gen_filters: "{{ [STANDARD_EDGE_FW__to_merge, custom_edge_fw] | community.general.lists_mergeby('name') }}"
......@@ -33,15 +33,15 @@
when: >
ap.sbp.custom_firewall_filters | ansible.builtin.bool
and
subscription.l3_core_service_type in l3_service_types.vprn
subscription.product.product_type | upper in l3_service_types.vprn
ansible.builtin.set_fact:
standard_nren_fw: "STANDARD_{{ subscription.l3_core_service_type }}_NREN_FW__to_merge"
standard_nren_fw: "STANDARD_{{ subscription.product.product_type | upper }}_NREN_FW__to_merge"
- name: Load Standard NREN FW
when: >
ap.sbp.custom_firewall_filters | ansible.builtin.bool
and
subscription.l3_core_service_type in l3_service_types.vprn
subscription.product.product_type | upper in l3_service_types.vprn
ansible.builtin.set_fact:
standard_nren_fw: "{{ lookup('community.general.merge_variables', standard_nren_fw) }}"
......@@ -50,7 +50,7 @@
when: >
ap.sbp.custom_firewall_filters | ansible.builtin.bool
and
subscription.l3_core_service_type in l3_service_types.vprn
subscription.product.product_type | upper in l3_service_types.vprn
ansible.builtin.set_fact:
custom_edge_fw: "{{ [CUSTOM_NREN_FW, standard_nren_fw] | community.general.lists_mergeby('name',
recursive=true, list_merge='append') }}"
......@@ -63,16 +63,12 @@
when: >
ap.sbp.custom_firewall_filters | ansible.builtin.bool
and
subscription.l3_core_service_type in l3_service_types.vprn
subscription.product.product_type | upper in l3_service_types.vprn
ansible.builtin.set_fact:
gen_filters: "{{ [STANDARD_EDGE_FW__to_merge, custom_edge_fw] | community.general.lists_mergeby('name') }}"
- name: Prepare FW vars for NREN L3 Core Service with standard filters
when: >-
subscription.product.product_type == "L3CoreService"
and
subscription.l3_core_service_type in l3_service_types.ies or subscription.l3_core_service_type in l3_service_types.vprn
and
when: >
not ap.sbp.custom_firewall_filters | ansible.builtin.bool
block:
- name: Merge NREN standard filters
......
---
- name: Set NREN community names
when: not subscription.l3_core_service_type in ['LHCONE']
when: not subscription.product.product_type | upper in ['LHCONE']
ansible.builtin.set_fact:
nren_community_names: ["GEANT_{{ partner_name | upper }}", "GEANT_{{ partner_name | upper }}_BLOCK"]
- name: Set NREN community names
when: subscription.l3_core_service_type in ['LHCONE']
when: subscription.product.product_type | upper in ['LHCONE']
ansible.builtin.set_fact:
nren_community_names: ["GEANT_{{ partner_name | upper }}", "LHCONE_{{ partner_name | upper }}_BLOCK"]
......
......@@ -2,7 +2,7 @@
# tasks file for policy_options
- name: Set BGP V4 session object to check for custom policies
when: >
subscription.product.product_type == "L3CoreService"
subscription.product.product_type | upper in l3_services.keys() | list
ansible.builtin.set_fact:
bgp_session_v4: "{{ ap.sbp | json_query(qry) }}"
vars:
......@@ -10,7 +10,7 @@
- name: Set BGP V6 session object to check for custom policies
when: >
subscription.product.product_type == "L3CoreService"
subscription.product.product_type | upper in l3_services.keys() | list
ansible.builtin.set_fact:
bgp_session_v6: "{{ ap.sbp | json_query(qry) }}"
vars:
......@@ -18,14 +18,14 @@
- name: Calculate NREN-specific communities
when: >
subscription.product.product_type == "L3CoreService"
subscription.product.product_type | upper in l3_services.keys() | list
ansible.builtin.include_tasks: calc_nren_communities.yaml
- name: Load GEANT-IP policies
when: >
subscription.product.product_type == "L3CoreService"
subscription.product.product_type | upper in l3_services.keys() | list
and
subscription.l3_core_service_type in l3_service_types.ies
subscription.product.product_type | upper in l3_service_types.ies
block:
- name: Load GEANT-IP standard policies if selected
when: >
......@@ -43,9 +43,9 @@
- name: Load IAS VRF policies
when: >
subscription.product.product_type == "L3CoreService"
subscription.product.product_type | upper in l3_services.keys() | list
and
subscription.l3_core_service_type == "IAS"
subscription.product.product_type | upper == "IAS"
block:
- name: Load NREN standard VRF policies
when: >
......@@ -63,11 +63,11 @@
- name: Load VRF policies
when: >
subscription.product.product_type == "L3CoreService"
subscription.product.product_type | upper in l3_services.keys() | list
and
subscription.l3_core_service_type in l3_service_types.vprn
subscription.product.product_type | upper in l3_service_types.vprn
and
not subscription.l3_core_service_type == "IAS"
not subscription.product.product_type | upper == "IAS"
block:
- name: Load NREN standard VRF policies
when: >
......@@ -83,6 +83,7 @@
bgp_session_v6.has_custom_policies | ansible.builtin.bool
ansible.builtin.include_tasks: merge_vrf_custom_vars.yaml
# TODO: Check product_type VRF
- name: Load Standard Policy Options for creation of VRF {{ subscription.vrf.vrf_name }}
when: >
subscription.product.product_type == "VRF"
......
---
- name: Load Standard Policy Options prefix lists for VRF {{ subscription.l3_core_service_type }}
- name: Load Standard Policy Options prefix lists for VRF {{ subscription.product.product_type | upper }}
ansible.builtin.set_fact:
po_final_prefix_lists: "{{ lookup('community.general.merge_variables', 'STANDARD_VRF_PO_PREFIX_LISTS') }}"
- name: Set the policy name based on the partner "ias_flavour" for {{ partner_name | upper }}
ansible.builtin.set_fact:
po_policy_name: "STANDARD_VRF_PO_POLICIES_{{ partner.ias_flavour }}"
po_policy_name: "STANDARD_VRF_PO_POLICIES_{{ subscription[subscription_key].ias_flavor }}"
- name: Load Standard Policy Options policies for {{ partner.ias_flavour }}
- name: Load Standard Policy Options policies for {{ subscription[subscription_key].ias_flavor }}
ansible.builtin.set_fact:
po_final_policies: "{{ lookup('community.general.merge_variables', po_policy_name) }}"
......@@ -53,7 +53,7 @@
ansible.builtin.set_fact:
po_final_policies: "{{ [po_final_policies, po_policy_default_route_v6] | community.general.lists_mergeby('name') }}"
- name: Load Standard Policy Options prefix lists for VRF {{ subscription.l3_core_service_type }}
- name: Load Standard Policy Options prefix lists for VRF {{ subscription.product.product_type | upper }}
ansible.builtin.set_fact:
po_vrf_communities: "{{ lookup('community.general.merge_variables', 'STANDARD_VRF_COMMUNITIES') }}"
......
---
- name: Load Standard Policy Options prefix lists for VRF {{ subscription.l3_core_service_type }}
- name: Load Standard Policy Options prefix lists for VRF {{ subscription.product.product_type | upper }}
ansible.builtin.set_fact:
po_final_prefix_lists: "{{ lookup('community.general.merge_variables', 'STANDARD_VRF_PO_PREFIX_LISTS') }}"
- name: Load Standard Policy Options policies for VRF {{ subscription.l3_core_service_type }}
- name: Load Standard Policy Options policies for VRF {{ subscription.product.product_type | upper }}
ansible.builtin.set_fact:
po_final_policies: "{{ lookup('community.general.merge_variables', 'CUSTOM_VRF_PO_POLICIES') }}"
- name: Load Standard Policy Options prefix lists for VRF {{ subscription.l3_core_service_type }}
- name: Load Standard Policy Options prefix lists for VRF {{ subscription.product.product_type | upper }}
ansible.builtin.set_fact:
po_vrf_communities: "{{ lookup('community.general.merge_variables', 'STANDARD_VRF_COMMUNITIES') }}"
......
---
- name: Load Standard Policy Options prefix lists for VRF {{ subscription.l3_core_service_type }}
- name: Load Standard Policy Options prefix lists for VRF {{ subscription.product.product_type | upper }}
ansible.builtin.set_fact:
po_final_prefix_lists: "{{ lookup('community.general.merge_variables', 'STANDARD_VRF_PO_PREFIX_LISTS') }}"
- name: Load Standard Policy Options policies for VRF {{ subscription.l3_core_service_type }}
- name: Load Standard Policy Options policies for VRF {{ subscription.product.product_type | upper }}
ansible.builtin.set_fact:
po_final_policies: "{{ lookup('community.general.merge_variables', 'STANDARD_VRF_PO_POLICIES') }}"
- name: Load Standard Policy Options prefix lists for VRF {{ subscription.l3_core_service_type }}
- name: Load Standard Policy Options prefix lists for VRF {{ subscription.product.product_type | upper }}
ansible.builtin.set_fact:
po_vrf_communities: "{{ lookup('community.general.merge_variables', 'STANDARD_VRF_COMMUNITIES') }}"
......
......@@ -4,24 +4,24 @@
{% 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 l3_service_types.ies %}
{% if subscription.product.product_type | upper in l3_service_types.ies %}
<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>
{% elif subscription.l3_core_service_type in l3_service_types.vprn %}
{% elif subscription.product.product_type | upper in l3_service_types.vprn %}
<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 l3_service_types.ies %}
{% if subscription.product.product_type | upper in l3_service_types.ies %}
<description>SRV_GLOBAL CUSTOMER {{ partner_name }} {{ '#'+ap.custom_service_name if ap.custom_service_name is string }} ${{ ap.sbp.gs_id }} | ASN{{ partner.asn }} | </description>
{% elif subscription.l3_core_service_type == 'IAS' %}
<description>SRV_IAS CUSTOMER {{ partner_name }} {{ '#'+ap.custom_service_name if ap.custom_service_name is string }} {{ partner.ias_flavour | regex_search('IAS(GWS)?(PS)?') }} ${{ ap.sbp.gs_id }} | ASN{{ partner.asn }} | </description>
{% elif subscription.product.product_type | upper == 'IAS' %}
<description>SRV_IAS CUSTOMER {{ partner_name }} {{ '#'+ap.custom_service_name if ap.custom_service_name is string }} {{ subscription[subscription_key].ias_flavor | regex_search('IAS(GWS)?(PS)?') }} ${{ ap.sbp.gs_id }} | ASN{{ partner.asn }} | </description>
<ingress>
<policy-accounting>GEANT_DEST_CLASS_POL_TEMPLATE_01</policy-accounting>
<destination-class-lookup>true</destination-class-lookup>
</ingress>
{% elif subscription.l3_core_service_type in l3_service_types.vprn %}
{% elif subscription.product.product_type | upper in l3_service_types.vprn %}
<description>SRV_L3VPN CUSTOMER {{ partner_name }} {{ '#'+ap.custom_service_name if ap.custom_service_name is string }} ${{ ap.sbp.gs_id }} | ASN{{ partner.asn }} | </description>
{% endif %}
<ip-mtu>{{ sbp_params.ip_mtu }}</ip-mtu>
......@@ -48,23 +48,23 @@
{% endif %}
<ingress>
<filter>
{% if subscription.l3_core_service_type in l3_service_types.ies %}
{% if subscription.product.product_type | upper in l3_service_types.ies %}
<ip>{{ partner_name | upper }}_{{ ap.ap_type[:1] }}_EDGE_IN</ip>
<ipv6>{{ partner_name | upper }}_{{ ap.ap_type[:1] }}_EDGE_IN_V6</ipv6>
{% elif subscription.l3_core_service_type in l3_service_types.vprn %}
<ip>{{ subscription.l3_core_service_type }}_{{ partner_name | upper }}_{{ ap.ap_type[:1] }}_IN</ip>
<ipv6>{{ subscription.l3_core_service_type }}_{{ partner_name | upper }}_{{ ap.ap_type[:1] }}_IN_V6</ipv6>
{% elif subscription.product.product_type | upper in l3_service_types.vprn %}
<ip>{{ subscription.product.product_type | upper }}_{{ partner_name | upper }}_{{ ap.ap_type[:1] }}_IN</ip>
<ipv6>{{ subscription.product.product_type | upper }}_{{ partner_name | upper }}_{{ ap.ap_type[:1] }}_IN_V6</ipv6>
{% endif %}
</filter>
</ingress>
<egress>
<filter>
{% if subscription.l3_core_service_type in l3_service_types.ies %}
{% if subscription.product.product_type | upper in l3_service_types.ies %}
<ip>{{ partner_name | upper }}_{{ ap.ap_type[:1] }}_EDGE_OUT</ip>
<ipv6>{{ partner_name | upper }}_{{ ap.ap_type[:1] }}_EDGE_OUT_V6</ipv6>
{% elif subscription.l3_core_service_type in l3_service_types.vprn %}
<ip>{{ subscription.l3_core_service_type }}_{{ partner_name | upper }}_{{ ap.ap_type[:1] }}_OUT</ip>
<ipv6>{{ subscription.l3_core_service_type }}_{{ partner_name | upper }}_{{ ap.ap_type[:1] }}_OUT_V6</ipv6>
{% elif subscription.product.product_type | upper in l3_service_types.vprn %}
<ip>{{ subscription.product.product_type | upper }}_{{ partner_name | upper }}_{{ ap.ap_type[:1] }}_OUT</ip>
<ipv6>{{ subscription.product.product_type | upper }}_{{ partner_name | upper }}_{{ ap.ap_type[:1] }}_OUT_V6</ipv6>
{% endif %}
</filter>
</egress>
......@@ -122,9 +122,9 @@
</address>
</ipv6>
</interface>
{% if subscription.l3_core_service_type in l3_service_types.ies %}
{% if subscription.product.product_type | upper in l3_service_types.ies %}
</ies>
{% elif subscription.l3_core_service_type in l3_service_types.vprn %}
{% elif subscription.product.product_type | upper in l3_service_types.vprn %}
</vprn>
{% endif %}
</service>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment