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 496b676335c..b6dd35e38e4 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 @@ -128,7 +128,7 @@ application traffic recognition application-profile voice ! field-set ipv4 prefix CONTROL-PLANE-APP-DEST-PREFIXES - 42.42.42.42/32 + 192.168.31.1/32 192.168.31.2/32 ! ip routing ip routing vrf IT 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 e462e2db638..cea30c4641d 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 @@ -114,7 +114,7 @@ application traffic recognition application-profile voice ! field-set ipv4 prefix CONTROL-PLANE-APP-DEST-PREFIXES - 42.42.42.42/32 + 192.168.30.0/24 192.168.31.2/32 ! ip routing no ip routing vrf MGMT 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 01a92e6bcce..9381652b55f 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 @@ -113,7 +113,7 @@ application traffic recognition application-profile voice ! field-set ipv4 prefix CONTROL-PLANE-APP-DEST-PREFIXES - 42.42.42.42/32 + 192.168.30.0/24 192.168.31.1/32 ! ip routing no ip routing vrf MGMT 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 1b2f33ddb41..19f573fd1e3 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 @@ -252,7 +252,7 @@ application traffic recognition application-profile voice ! field-set ipv4 prefix CONTROL-PLANE-APP-DEST-PREFIXES - 42.42.42.42/32 + 192.168.44.1/32 ! ip routing ip routing vrf IT 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 6c0234de679..fc8ad2bb3d0 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 @@ -248,7 +248,7 @@ application traffic recognition application-profile voice ! field-set ipv4 prefix CONTROL-PLANE-APP-DEST-PREFIXES - 42.42.42.42/32 + 192.168.42.0/24 192.168.43.0/24 ! ip routing no ip routing vrf MGMT 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 a57cb409310..837cd4e781e 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 @@ -237,7 +237,7 @@ application traffic recognition application-profile voice ! field-set ipv4 prefix CONTROL-PLANE-APP-DEST-PREFIXES - 42.42.42.42/32 + 192.168.42.0/24 192.168.43.0/24 192.168.44.3/32 6.6.6.6/32 ! ip routing no ip routing vrf MGMT 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 92be117523e..b66fb4601ac 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 @@ -252,7 +252,7 @@ application traffic recognition application-profile voice ! field-set ipv4 prefix CONTROL-PLANE-APP-DEST-PREFIXES - 42.42.42.42/32 + 192.168.42.0/24 192.168.43.0/24 192.168.44.2/32 6.6.6.6/32 ! ip routing no ip routing vrf MGMT 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 19e11cb3c42..f9bfa0d7f18 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 @@ -268,7 +268,7 @@ application traffic recognition application-profile voice ! field-set ipv4 prefix CONTROL-PLANE-APP-DEST-PREFIXES - 42.42.42.42/32 + 192.168.44.1/32 ! ip routing ip routing vrf IT 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 ec2a797f5a1..252af9d7bcd 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 @@ -190,7 +190,8 @@ application_traffic_recognition: ipv4_prefixes: - name: CONTROL-PLANE-APP-DEST-PREFIXES prefix_values: - - 42.42.42.42/32 + - 192.168.31.1/32 + - 192.168.31.2/32 dps_interfaces: - name: Dps1 description: DPS Interface 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 d5a68b13e72..b51a724d71f 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 @@ -188,7 +188,8 @@ application_traffic_recognition: ipv4_prefixes: - name: CONTROL-PLANE-APP-DEST-PREFIXES prefix_values: - - 42.42.42.42/32 + - 192.168.31.2/32 + - 192.168.30.0/24 dps_interfaces: - name: Dps1 description: DPS Interface 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 e6e72d88e30..cc5e7d5db8b 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 @@ -190,7 +190,8 @@ application_traffic_recognition: ipv4_prefixes: - name: CONTROL-PLANE-APP-DEST-PREFIXES prefix_values: - - 42.42.42.42/32 + - 192.168.31.1/32 + - 192.168.30.0/24 dps_interfaces: - name: Dps1 description: DPS Interface 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 87ce60341ab..b882e09afc2 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 @@ -337,7 +337,7 @@ application_traffic_recognition: ipv4_prefixes: - name: CONTROL-PLANE-APP-DEST-PREFIXES prefix_values: - - 42.42.42.42/32 + - 192.168.44.1/32 dps_interfaces: - name: Dps1 description: DPS Interface 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 399f23742f4..ce8e7565894 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 @@ -329,7 +329,8 @@ application_traffic_recognition: ipv4_prefixes: - name: CONTROL-PLANE-APP-DEST-PREFIXES prefix_values: - - 42.42.42.42/32 + - 192.168.42.0/24 + - 192.168.43.0/24 dps_interfaces: - name: Dps1 description: DPS Interface @@ -420,8 +421,6 @@ metadata: sites: - name: Site422 id: 422 - location: - address: Somewhere - name: AVD_Land_East id: 43 zones: 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 3eed623ca7c..2f45ab432b6 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 @@ -339,7 +339,10 @@ application_traffic_recognition: ipv4_prefixes: - name: CONTROL-PLANE-APP-DEST-PREFIXES prefix_values: - - 42.42.42.42/32 + - 192.168.44.3/32 + - 6.6.6.6/32 + - 192.168.42.0/24 + - 192.168.43.0/24 dps_interfaces: - name: Dps1 description: DPS Interface @@ -406,8 +409,6 @@ metadata: sites: - name: Site422 id: 422 - location: - address: Somewhere - name: AVD_Land_East id: 43 zones: 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 cab3bc80d27..0e25b6fe682 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 @@ -357,7 +357,10 @@ application_traffic_recognition: ipv4_prefixes: - name: CONTROL-PLANE-APP-DEST-PREFIXES prefix_values: - - 42.42.42.42/32 + - 192.168.44.2/32 + - 6.6.6.6/32 + - 192.168.42.0/24 + - 192.168.43.0/24 dps_interfaces: - name: Dps1 description: DPS Interface @@ -436,8 +439,6 @@ metadata: sites: - name: Site422 id: 422 - location: - address: Somewhere - name: AVD_Land_East id: 43 zones: 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 1c58cd6701c..f92516883e2 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 @@ -352,7 +352,7 @@ application_traffic_recognition: ipv4_prefixes: - name: CONTROL-PLANE-APP-DEST-PREFIXES prefix_values: - - 42.42.42.42/32 + - 192.168.44.1/32 dps_interfaces: - name: Dps1 description: DPS Interface diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/CV_PATHFINDER_TESTS.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/CV_PATHFINDER_TESTS.yml index 0861bbd793f..eec382fe4ef 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/CV_PATHFINDER_TESTS.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/CV_PATHFINDER_TESTS.yml @@ -11,7 +11,6 @@ cv_pathfinder_regions: sites: - name: Site422 id: 422 - location: Somewhere - name: AVD_Land_East id: 43 description: AVD Region diff --git a/ansible_collections/arista/avd/plugins/plugin_utils/eos_designs_shared_utils/wan.py b/ansible_collections/arista/avd/plugins/plugin_utils/eos_designs_shared_utils/wan.py index 2c677885d3f..e2e902aee68 100644 --- a/ansible_collections/arista/avd/plugins/plugin_utils/eos_designs_shared_utils/wan.py +++ b/ansible_collections/arista/avd/plugins/plugin_utils/eos_designs_shared_utils/wan.py @@ -41,6 +41,15 @@ def wan_role(self: SharedUtils) -> str | None: raise AristaAvdError("'wan_role' client requires 'evpn_role' client.") return wan_role + @cached_property + def wan_listen_ranges(self) -> list: + return get( + self.bgp_peer_groups["wan_overlay_peers"], + "listen_range_prefixes", + required=True, + org_key="bgp_peer_groups.wan_overlay_peers.listen_range_prefixes", + ) + @cached_property def cv_pathfinder_role(self: SharedUtils) -> str | None: if self.underlay_router is False or self.wan_mode != "cv-pathfinder": diff --git a/ansible_collections/arista/avd/roles/eos_designs/python_modules/network_services/application_traffic_recognition.py b/ansible_collections/arista/avd/roles/eos_designs/python_modules/network_services/application_traffic_recognition.py index c5a3a60884e..cab8b52566b 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/python_modules/network_services/application_traffic_recognition.py +++ b/ansible_collections/arista/avd/roles/eos_designs/python_modules/network_services/application_traffic_recognition.py @@ -88,8 +88,10 @@ def _generate_control_plane_application_profile(self, app_dict: dict) -> None: ipv4_prefixes_field_sets = get(app_dict, "field_sets.ipv4_prefixes", []) if get_item(ipv4_prefixes_field_sets, "name", self._wan_cp_app_dst_prefix) is not None: return - # pathfinder_router_ids = [wan_rs_data.get("router_id") for wan_rs, wan_rs_data in self.shared_utils.wan_route_servers.items()] - pathfinder_router_ids = ["42.42.42.42/32"] + pathfinder_router_ids = [f"{wan_rs_data.get('router_id')}/32" for wan_rs, wan_rs_data in self.shared_utils.filtered_wan_route_servers.items()] + if self.shared_utils.wan_role == "server": + pathfinder_router_ids.extend(self.shared_utils.wan_listen_ranges) + app_dict.setdefault("field_sets", {}).setdefault("ipv4_prefixes", []).append( { "name": self._wan_cp_app_dst_prefix, @@ -143,7 +145,7 @@ def _append_object_to_list_of_dicts(path: str, obj_name: str, list_of_dicts: lis obj_name=application_profile, list_of_dicts=application_profiles, message=( - f"The application profile {application_profile} used in one of the policies " + f"The application profile {application_profile} used in policy {policy['name']} " "is not defined in 'application_traffic_recognition.application_profiles'." ), ) @@ -156,7 +158,7 @@ def _append_object_to_list_of_dicts(path: str, obj_name: str, list_of_dicts: lis obj_name=application_profile, list_of_dicts=application_profiles, message=( - f"The application profile {application_profile} used in one of the policies " + f"The application profile {application_profile} used in policy {policy['name']} " "is not defined in 'application_traffic_recognition.application_profiles'." ), ) diff --git a/ansible_collections/arista/avd/roles/eos_designs/python_modules/network_services/router_adaptive_virtual_topology.py b/ansible_collections/arista/avd/roles/eos_designs/python_modules/network_services/router_adaptive_virtual_topology.py index a10010bf01f..c52e42485c8 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/python_modules/network_services/router_adaptive_virtual_topology.py +++ b/ansible_collections/arista/avd/roles/eos_designs/python_modules/network_services/router_adaptive_virtual_topology.py @@ -117,7 +117,6 @@ def _augmented_cv_pathfinder_policies(self) -> list: default_virtual_topology = get(avt_policy, "default_virtual_topology", required=True) if not get(default_virtual_topology, "drop_unmatched", default=False): application_profile = get(default_virtual_topology, "application_profile", default="default") - self._assert_application_profile_exist(application_profile) cv_pathfinder_policy["matches"].append( { "application_profile": application_profile, diff --git a/ansible_collections/arista/avd/roles/eos_designs/python_modules/network_services/router_path_selection.py b/ansible_collections/arista/avd/roles/eos_designs/python_modules/network_services/router_path_selection.py index 54a7cd3de16..4cf1d4364f4 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/python_modules/network_services/router_path_selection.py +++ b/ansible_collections/arista/avd/roles/eos_designs/python_modules/network_services/router_path_selection.py @@ -74,7 +74,6 @@ def _autovpn_policies(self) -> list: for rule_id, application_virtual_topology in enumerate(get(policy, "application_virtual_topologies", []), start=1): name = get(application_virtual_topology, "name", default=f"{policy['name']}_{application_virtual_topology['application_profile']}") application_profile = get(application_virtual_topology, "application_profile", required=True) - self._assert_application_profile_exist(application_profile) autovpn_policy.setdefault("rules", []).append( { "id": 10 * (rule_id + rule_id_offset), 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 2c04aa92ab4..d759c815da8 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 @@ -404,23 +404,3 @@ def _default_vrf_policy(self) -> dict: ).copy() default_policy["is_default"] = True return default_policy - - def _assert_application_profile_exist(self, application_profile: str) -> None: - """ - Check that the application_profile name exists in the `application_traffic_recognition` block - or is `default` - otherwise raise AristaAvdMissingVariableError - """ - if application_profile == "default": - return - application_profiles = get(self._hostvars, "application_traffic_recognition.application_profiles", []) - get_item( - application_profiles, - "name", - application_profile, - required=True, - custom_error_msg=( - f"The application profile {application_profile} used in one of the policies " - "is not defined in 'application_traffic_recognition.application_profiles'." - ), - ) diff --git a/ansible_collections/arista/avd/roles/eos_designs/python_modules/overlay/router_bgp.py b/ansible_collections/arista/avd/roles/eos_designs/python_modules/overlay/router_bgp.py index 027779163ae..35043c36b01 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/python_modules/overlay/router_bgp.py +++ b/ansible_collections/arista/avd/roles/eos_designs/python_modules/overlay/router_bgp.py @@ -66,7 +66,7 @@ def _bgp_listen_ranges(self) -> list | None: "peer_group": self.shared_utils.bgp_peer_groups["wan_overlay_peers"]["name"], "remote_as": self.shared_utils.bgp_as, } - for prefix in self._wan_listen_ranges + for prefix in self.shared_utils.wan_listen_ranges ] or None def _generate_base_peer_group(self, pg_type: str, pg_name: str, maximum_routes: int = 0) -> dict: @@ -479,7 +479,7 @@ def _neighbors(self) -> list | None: neighbors.append(neighbor) if self.shared_utils.wan_role == "client": - if not self._router_id_in_listen_ranges(self._wan_listen_ranges): + if not self._router_id_in_listen_ranges(self.shared_utils.wan_listen_ranges): raise AristaAvdError( f"Loopback0 IP {self.shared_utils.router_id} is not in the Route Reflector listen range prefixes" " 'bgp_peer_groups.wan_overlay_peers.listen_range_prefixes'." diff --git a/ansible_collections/arista/avd/roles/eos_designs/python_modules/overlay/utils.py b/ansible_collections/arista/avd/roles/eos_designs/python_modules/overlay/utils.py index c5df100de65..f9d8644d4a7 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/python_modules/overlay/utils.py +++ b/ansible_collections/arista/avd/roles/eos_designs/python_modules/overlay/utils.py @@ -262,10 +262,6 @@ def _append_peer(self, peers_dict: dict, peer_name: str, peer_facts: dict) -> No def _is_wan_server_with_peers(self) -> bool: return self.shared_utils.wan_role == "server" and len(self.shared_utils.filtered_wan_route_servers) > 0 - @cached_property - def _wan_listen_ranges(self): - return get(self.shared_utils.bgp_peer_groups["wan_overlay_peers"], "listen_range_prefixes", required=True) - def _stun_server_profile_name(self, wan_route_server_name: str, path_group_name: str, interface_name: str) -> str: """ Return a string to use as the name of the stun server_profile