diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/autovpn-edge.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/autovpn-edge.cfg index bbe8fab3785..c14231a8193 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/autovpn-edge.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/autovpn-edge.cfg @@ -29,6 +29,9 @@ router path-selection load-balance policy it_it_lb path-group INET priority 2 ! + load-balance policy voice_default_lb + path-group INET priority 1 + ! load-balance policy voice_voice_lb path-group INET priority 1 ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/autovpn-rr1.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/autovpn-rr1.cfg index e45fb66e4b5..045e4b5a5ad 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/autovpn-rr1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/autovpn-rr1.cfg @@ -19,6 +19,9 @@ router path-selection load-balance policy it_it_lb path-group INET priority 2 ! + load-balance policy voice_default_lb + path-group INET priority 1 + ! load-balance policy voice_voice_lb path-group INET priority 1 ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/autovpn-rr2.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/autovpn-rr2.cfg index 76a96a2df63..3d817da9be1 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/autovpn-rr2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/autovpn-rr2.cfg @@ -19,6 +19,9 @@ router path-selection load-balance policy it_it_lb path-group INET priority 2 ! + load-balance policy voice_default_lb + path-group INET priority 1 + ! load-balance policy voice_voice_lb path-group INET priority 1 ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-edge.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-edge.cfg index 3057c27b120..e62071dcc71 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-edge.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-edge.cfg @@ -41,6 +41,10 @@ router path-selection path-group INET priority 1 path-group MPLS priority 1 ! + load-balance policy voice_default_lb + path-group INET priority 1 + path-group MPLS priority 2 + ! load-balance policy voice_voice_lb path-group MPLS priority 1 path-group INET priority 2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-pathfinder.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-pathfinder.cfg index e888c1cf534..6b385660966 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-pathfinder.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-pathfinder.cfg @@ -33,6 +33,10 @@ router path-selection path-group INET priority 1 path-group MPLS priority 1 ! + load-balance policy voice_default_lb + path-group INET priority 1 + path-group MPLS priority 2 + ! load-balance policy voice_voice_lb path-group MPLS priority 1 path-group INET priority 2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-pathfinder1.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-pathfinder1.cfg index c69102216d3..77721e49daa 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-pathfinder1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-pathfinder1.cfg @@ -29,6 +29,10 @@ router path-selection path-group INET priority 1 path-group MPLS priority 1 ! + load-balance policy voice_default_lb + path-group INET priority 1 + path-group MPLS priority 2 + ! load-balance policy voice_voice_lb path-group MPLS priority 1 path-group INET priority 2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-pathfinder2.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-pathfinder2.cfg index 6846607aaee..33b30c15058 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-pathfinder2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-pathfinder2.cfg @@ -29,6 +29,10 @@ router path-selection path-group INET priority 1 path-group MPLS priority 1 ! + load-balance policy voice_default_lb + path-group INET priority 1 + path-group MPLS priority 2 + ! load-balance policy voice_voice_lb path-group MPLS priority 1 path-group INET priority 2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-transit.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-transit.cfg index 9ad4bf24170..b7cc6a6e973 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-transit.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-transit.cfg @@ -46,6 +46,10 @@ router path-selection path-group INET priority 1 path-group MPLS priority 1 ! + load-balance policy voice_default_lb + path-group INET priority 1 + path-group MPLS priority 2 + ! load-balance policy voice_voice_lb path-group MPLS priority 1 path-group INET priority 2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/autovpn-edge.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/autovpn-edge.yml index 46888ff999d..f52d84e9b5d 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/autovpn-edge.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/autovpn-edge.yml @@ -124,6 +124,10 @@ router_path_selection: path_groups: - name: INET priority: 1 + - name: voice_default_lb + path_groups: + - name: INET + priority: 1 - name: it_it_lb path_groups: - name: INET diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/autovpn-rr1.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/autovpn-rr1.yml index 023d7ce5f75..f28fadbcf8c 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/autovpn-rr1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/autovpn-rr1.yml @@ -119,6 +119,10 @@ router_path_selection: path_groups: - name: INET priority: 1 + - name: voice_default_lb + path_groups: + - name: INET + priority: 1 - name: it_it_lb path_groups: - name: INET diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/autovpn-rr2.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/autovpn-rr2.yml index 85d59d3f441..e5c9dae71de 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/autovpn-rr2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/autovpn-rr2.yml @@ -119,6 +119,10 @@ router_path_selection: path_groups: - name: INET priority: 1 + - name: voice_default_lb + path_groups: + - name: INET + priority: 1 - name: it_it_lb path_groups: - name: INET diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-edge.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-edge.yml index ed6689a2022..a496c4c7339 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-edge.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-edge.yml @@ -200,6 +200,12 @@ router_path_selection: priority: 1 - name: INET priority: 2 + - name: voice_default_lb + path_groups: + - name: INET + priority: 1 + - name: MPLS + priority: 2 - name: it_it_lb path_groups: - name: INET diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-pathfinder.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-pathfinder.yml index e3f8574e202..fc9dc239ed0 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-pathfinder.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-pathfinder.yml @@ -181,6 +181,12 @@ router_path_selection: priority: 1 - name: INET priority: 2 + - name: voice_default_lb + path_groups: + - name: INET + priority: 1 + - name: MPLS + priority: 2 - name: it_it_lb path_groups: - name: INET diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-pathfinder1.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-pathfinder1.yml index 819c92b75e5..57335c9334a 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-pathfinder1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-pathfinder1.yml @@ -203,6 +203,12 @@ router_path_selection: priority: 1 - name: INET priority: 2 + - name: voice_default_lb + path_groups: + - name: INET + priority: 1 + - name: MPLS + priority: 2 - name: it_it_lb path_groups: - name: INET diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-pathfinder2.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-pathfinder2.yml index 1ea49780420..728d391ed7e 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-pathfinder2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-pathfinder2.yml @@ -203,6 +203,12 @@ router_path_selection: priority: 1 - name: INET priority: 2 + - name: voice_default_lb + path_groups: + - name: INET + priority: 1 + - name: MPLS + priority: 2 - name: it_it_lb path_groups: - name: INET diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-transit.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-transit.yml index 6fbff8463f8..04f940e7a7f 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-transit.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-transit.yml @@ -208,6 +208,12 @@ router_path_selection: priority: 1 - name: INET priority: 2 + - name: voice_default_lb + path_groups: + - name: INET + priority: 1 + - name: MPLS + priority: 2 - name: it_it_lb path_groups: - name: INET diff --git a/ansible_collections/arista/avd/roles/eos_designs/python_modules/network_services/utils.py b/ansible_collections/arista/avd/roles/eos_designs/python_modules/network_services/utils.py index f23ba201fbf..7f30ee12fc7 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/python_modules/network_services/utils.py +++ b/ansible_collections/arista/avd/roles/eos_designs/python_modules/network_services/utils.py @@ -368,4 +368,27 @@ def _wan_load_balance_policies(self) -> list: # TODO implement also the jitter / ... wan_load_balance_policies.append(wan_load_balance_policy) + if default_policy := get(avt_policy, "default_policy"): + name = get(default_policy, "name", default=f"{avt_policy['name']}_default") + wan_load_balance_policy = {"name": f"{name}_lb"} + + # TODO add LAN_HA with prio 1 when HA is implemented + # TODO for now hardcoding priorities as requested by team + for path_group in get(default_policy, "preferred_path_groups", []): + wan_load_balance_policy.setdefault("path_groups", []).append( + { + "name": path_group, + "priority": 1, + } + ) + for path_group in get(default_policy, "alternate_path_groups", []): + wan_load_balance_policy.setdefault("path_groups", []).append( + { + "name": path_group, + "priority": 2, + } + ) + + wan_load_balance_policies.append(wan_load_balance_policy) + return wan_load_balance_policies