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

`policy_options`: Take LP and MED values from GSO subscription for RE Peers.

parent 0fe4c0c7
No related branches found
No related tags found
1 merge request!283`policy_options`: Take LP and MED values from GSO subscription for RE Peers.
Pipeline #95256 passed
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
- name: Generate export policy entries for GREEN communities - name: Generate export policy entries for GREEN communities
ansible.builtin.set_fact: ansible.builtin.set_fact:
ps_to_re_green: "{{ ps_to_re_green | default([]) + [ {'name': 'ANNOUNCE_'+(idx_green+2)|string, 'from': {'community': item}, ps_to_re_green: "{{ ps_to_re_green | default([]) + [ {'name': 'ANNOUNCE_'+(idx_green+2)|string, 'from': {'community': item},
'action_type': 'accept', 'action': [ {'bgp_med': 'igp', 'community_remove': ['TE_PRIVATE_COMMUNITIES'] } ]} ] }}" 'action_type': 'accept', 'action': [ {'bgp_med': gso_bgp_med_v4, 'community_remove': ['TE_PRIVATE_COMMUNITIES'] } ]} ] }}"
loop: "{{ green_comm_names }}" loop: "{{ green_comm_names }}"
loop_control: loop_control:
index_var: idx_green index_var: idx_green
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
when: yellow_peers | length > 0 when: yellow_peers | length > 0
ansible.builtin.set_fact: ansible.builtin.set_fact:
ps_to_re_yellow: "{{ ps_to_re_yellow | default([]) + [ {'name': 'ANNOUNCE_'+((green_len|int+idx_yellow)|string), 'from': {'community': item}, ps_to_re_yellow: "{{ ps_to_re_yellow | default([]) + [ {'name': 'ANNOUNCE_'+((green_len|int+idx_yellow)|string), 'from': {'community': item},
'action_type': 'accept', 'action': [{'bgp_med': 'igp', 'community_remove': ['TE_PRIVATE_COMMUNITIES']} ]} ] }}" 'action_type': 'accept', 'action': [{'bgp_med': gso_bgp_med_v4, 'community_remove': ['TE_PRIVATE_COMMUNITIES']} ]} ] }}"
loop: "{{ rande_te_communities_names }}" loop: "{{ rande_te_communities_names }}"
loop_control: loop_control:
index_var: idx_yellow index_var: idx_yellow
......
...@@ -3,6 +3,13 @@ ...@@ -3,6 +3,13 @@
- name: Include extract_bgp_objects - name: Include extract_bgp_objects
ansible.builtin.include_tasks: extract_bgp_objects.yaml ansible.builtin.include_tasks: extract_bgp_objects.yaml
- name: Set BGP metrics for RE from GSO subscription values
ansible.builtin.set_fact:
gso_bgp_med_v4: "{{ subscription[subscription_key].v4_bgp_med }}"
gso_bgp_med_v6: "{{ subscription[subscription_key].v6_bgp_med }}"
gso_bgp_lp_v4: "{{ subscription[subscription_key].v4_bgp_local_preference }}"
gso_bgp_lp_v6: "{{ subscription[subscription_key].v6_bgp_local_preference }}"
- name: Prepare vars for the RE Peer - name: Prepare vars for the RE Peer
when: gso_product_type == 'RANDEPEER' when: gso_product_type == 'RANDEPEER'
block: block:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment