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

Update `policy_options` for LHCONE access

parent ba979de9
No related branches found
No related tags found
1 merge request!208Update `vrf` role
---
# 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
......
---
- 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') }}"
......@@ -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') }}"
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment