From 11fbf3d50e4ce9e131c6437f18907566a0f5db8b Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Fri, 18 Oct 2024 12:52:48 +0530 Subject: [PATCH 01/30] Feat(eos_desings): Improve settings for --- .../intended/configs/l3_edge_bgp.cfg | 5 +++++ .../intended/configs/l3_edge_isis.cfg | 5 +++++ .../intended/configs/l3_edge_ospf.cfg | 5 +++++ .../structured_configs/l3_edge_bgp.yml | 7 +++++++ .../structured_configs/l3_edge_isis.yml | 7 +++++++ .../structured_configs/l3_edge_ospf.yml | 7 +++++++ .../eos_designs/docs/tables/core-interfaces.md | 18 ++++++++++++++++++ .../roles/eos_designs/docs/tables/l3-edge.md | 18 ++++++++++++++++++ .../schema_fragments/defs_p2p_links.schema.yml | 14 ++++++++++++++ .../ethernet_interfaces.py | 5 +++-- .../core_interfaces_and_l3_edge/utils.py | 7 ++++++- 11 files changed, 95 insertions(+), 3 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_bgp.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_bgp.cfg index 4cfaba9b585..07b5e727b4a 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_bgp.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_bgp.cfg @@ -44,6 +44,11 @@ interface ethernet1 ip address 192.168.0.0/31 mac security profile TEST-MACSEC-PROFILE ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 service-policy type qos input TEST_POLICY service-profile TEST-QOS-PROFILE ! TEST RAW_EOS_CLI diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_isis.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_isis.cfg index c1ff76a9de2..5ef8312d6bb 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_isis.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_isis.cfg @@ -30,6 +30,11 @@ interface ethernet1 ip address 192.168.0.0/31 mac security profile TEST-MACSEC-PROFILE ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 service-profile TEST-QOS-PROFILE ! interface ethernet2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_ospf.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_ospf.cfg index 762df9dc35f..1d21fc9811b 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_ospf.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_ospf.cfg @@ -30,6 +30,11 @@ interface ethernet1 ip address 192.168.0.0/31 mac security profile TEST-MACSEC-PROFILE ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 service-profile TEST-QOS-PROFILE ! interface ethernet2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_bgp.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_bgp.yml index c3ceb717a5f..2a98bc26724 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_bgp.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_bgp.yml @@ -108,6 +108,13 @@ ethernet_interfaces: description: P2P_peer1_ethernet1 speed: forced 10000full ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 enable: true service_policy: qos: diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_isis.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_isis.yml index 207a4a9a407..5778cf3e450 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_isis.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_isis.yml @@ -54,6 +54,13 @@ ethernet_interfaces: description: P2P_peer1_ethernet1 speed: forced 10000full ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 enable: true - name: ethernet2 peer: peer2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_ospf.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_ospf.yml index 703e8a7d313..cf447af509a 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_ospf.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_ospf.yml @@ -55,6 +55,13 @@ ethernet_interfaces: description: P2P_peer1_ethernet1 speed: forced 10000full ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 enable: true - name: ethernet2 peer: peer2 diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md index ccdb0ec2844..be55d7935cb 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md @@ -42,6 +42,8 @@ | [      bfd](## "core_interfaces.p2p_links_profiles.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "core_interfaces.p2p_links_profiles.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "core_interfaces.p2p_links_profiles.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | + | [        role](## "core_interfaces.p2p_links_profiles.[].ptp.role") | String | | `bmca` | Valid Values:
- bmca
- master | | + | [        profile](## "core_interfaces.p2p_links_profiles.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "core_interfaces.p2p_links_profiles.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "core_interfaces.p2p_links_profiles.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | | [      flow_tracking](## "core_interfaces.p2p_links_profiles.[].flow_tracking") | Dictionary | | | | Enable flow-tracking. Overrides `fabric_flow_tracking` setting. | @@ -90,6 +92,8 @@ | [      bfd](## "core_interfaces.p2p_links.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "core_interfaces.p2p_links.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "core_interfaces.p2p_links.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | + | [        role](## "core_interfaces.p2p_links.[].ptp.role") | String | | `bmca` | Valid Values:
- bmca
- master | | + | [        profile](## "core_interfaces.p2p_links.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "core_interfaces.p2p_links.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "core_interfaces.p2p_links.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | | [      flow_tracking](## "core_interfaces.p2p_links.[].flow_tracking") | Dictionary | | | | Enable flow-tracking. Overrides `fabric_flow_tracking` setting. | @@ -213,6 +217,13 @@ # Enable PTP. enabled: + role: + + # Default available profiles are: + # - "aes67" + # - "aes67-r16-2016" + # - "smpte2059-2" + profile: # Enable sFlow. Overrides `fabric_sflow` setting. sflow: @@ -359,6 +370,13 @@ # Enable PTP. enabled: + role: + + # Default available profiles are: + # - "aes67" + # - "aes67-r16-2016" + # - "smpte2059-2" + profile: # Enable sFlow. Overrides `fabric_sflow` setting. sflow: diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md index 40eb4f7d50e..4ebe4105976 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md @@ -42,6 +42,8 @@ | [      bfd](## "l3_edge.p2p_links_profiles.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "l3_edge.p2p_links_profiles.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "l3_edge.p2p_links_profiles.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | + | [        role](## "l3_edge.p2p_links_profiles.[].ptp.role") | String | | `bmca` | Valid Values:
- bmca
- master | | + | [        profile](## "l3_edge.p2p_links_profiles.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "l3_edge.p2p_links_profiles.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "l3_edge.p2p_links_profiles.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | | [      flow_tracking](## "l3_edge.p2p_links_profiles.[].flow_tracking") | Dictionary | | | | Enable flow-tracking. Overrides `fabric_flow_tracking` setting. | @@ -90,6 +92,8 @@ | [      bfd](## "l3_edge.p2p_links.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "l3_edge.p2p_links.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "l3_edge.p2p_links.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | + | [        role](## "l3_edge.p2p_links.[].ptp.role") | String | | `bmca` | Valid Values:
- bmca
- master | | + | [        profile](## "l3_edge.p2p_links.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "l3_edge.p2p_links.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "l3_edge.p2p_links.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | | [      flow_tracking](## "l3_edge.p2p_links.[].flow_tracking") | Dictionary | | | | Enable flow-tracking. Overrides `fabric_flow_tracking` setting. | @@ -213,6 +217,13 @@ # Enable PTP. enabled: + role: + + # Default available profiles are: + # - "aes67" + # - "aes67-r16-2016" + # - "smpte2059-2" + profile: # Enable sFlow. Overrides `fabric_sflow` setting. sflow: @@ -359,6 +370,13 @@ # Enable PTP. enabled: + role: + + # Default available profiles are: + # - "aes67" + # - "aes67-r16-2016" + # - "smpte2059-2" + profile: # Enable sFlow. Overrides `fabric_sflow` setting. sflow: diff --git a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml index 88e455074c7..d06b025ff05 100644 --- a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml @@ -132,6 +132,20 @@ $defs: type: bool default: false description: Enable PTP. + role: + type: str + default: "bmca" + valid_values: + - "bmca" + - "master" + profile: + type: str + default: "aes67-r16-2016" + description: |- + Default available profiles are: + - "aes67" + - "aes67-r16-2016" + - "smpte2059-2" sflow: type: bool description: Enable sFlow. Overrides `fabric_sflow` setting. diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/ethernet_interfaces.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/ethernet_interfaces.py index cc6e3bb6fd4..817854c1ad2 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/ethernet_interfaces.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/ethernet_interfaces.py @@ -30,9 +30,10 @@ def ethernet_interfaces(self: AvdStructuredConfigCoreInterfacesAndL3Edge) -> lis for p2p_link in self._filtered_p2p_links: if p2p_link["data"]["port_channel_id"] is None: # Ethernet interface + context = f"{self.data_model}" ethernet_interface = self._get_common_interface_cfg(p2p_link) ethernet_interface["description"] = self._p2p_link_ethernet_description(p2p_link) - ethernet_interface.update(self._get_ethernet_cfg(p2p_link)) + ethernet_interface.update(self._get_ethernet_cfg(p2p_link, context)) # Remove None values ethernet_interface = {key: value for key, value in ethernet_interface.items() if value is not None} @@ -49,7 +50,7 @@ def ethernet_interfaces(self: AvdStructuredConfigCoreInterfacesAndL3Edge) -> lis for member in p2p_link["data"]["port_channel_members"]: ethernet_interface = self._get_port_channel_member_cfg(p2p_link, member) ethernet_interface["description"] = self._port_channel_member_description(p2p_link, member) - ethernet_interface.update(self._get_ethernet_cfg(p2p_link)) + ethernet_interface.update(self._get_ethernet_cfg(p2p_link, context)) # Remove None values ethernet_interface = {key: value for key, value in ethernet_interface.items() if value is not None} diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py index f81576c0faf..073ce062f07 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py @@ -293,7 +293,7 @@ def _get_common_interface_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, return interface_cfg - def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link: dict) -> dict: + def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link: dict, context: str) -> dict: """ Return partial structured_config for one p2p_link. @@ -307,6 +307,11 @@ def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link ptp_config = {} + + if (ptp_profile_name := get(p2p_link, "ptp.profile", default=self.shared_utils.ptp_profile_name)) is not None: + msg = f"PTP Profile '{ptp_profile_name}' referenced under {context} does not exist in `ptp_profiles`." + ptp_config.update(get_item(self.shared_utils.ptp_profiles, "profile", ptp_profile_name, required=True, custom_error_msg=msg)) + # Apply PTP profile config if self.shared_utils.ptp_enabled: ptp_config.update(self.shared_utils.ptp_profile) From 67380017b39f8438ca61a0de5cc82d780c7c7861 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 07:27:39 +0000 Subject: [PATCH 02/30] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../structured_config/core_interfaces_and_l3_edge/utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py index 073ce062f07..ec8b9a8a2dc 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py @@ -307,7 +307,6 @@ def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link ptp_config = {} - if (ptp_profile_name := get(p2p_link, "ptp.profile", default=self.shared_utils.ptp_profile_name)) is not None: msg = f"PTP Profile '{ptp_profile_name}' referenced under {context} does not exist in `ptp_profiles`." ptp_config.update(get_item(self.shared_utils.ptp_profiles, "profile", ptp_profile_name, required=True, custom_error_msg=msg)) From fd8cfee940a9f7ae7ce834614e6224a23e050329 Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Fri, 18 Oct 2024 13:10:42 +0530 Subject: [PATCH 03/30] Run molecule --- .../documentation/devices/DC1-POD1-LEAF2B.md | 5 +++++ .../documentation/devices/DC1-POD2-SPINE2.md | 5 +++++ .../documentation/devices/DC1-SUPER-SPINE1.md | 5 +++++ .../documentation/devices/DC2-POD1-LEAF1A.md | 5 +++++ .../documentation/devices/DC2-POD1-SPINE2.md | 5 +++++ .../documentation/devices/DC2-SUPER-SPINE1.md | 5 +++++ .../intended/configs/DC1-POD1-LEAF2B.cfg | 5 +++++ .../intended/configs/DC1-POD2-SPINE2.cfg | 5 +++++ .../intended/configs/DC1-SUPER-SPINE1.cfg | 5 +++++ .../intended/configs/DC2-POD1-LEAF1A.cfg | 5 +++++ .../intended/configs/DC2-POD1-SPINE2.cfg | 5 +++++ .../intended/configs/DC2-SUPER-SPINE1.cfg | 5 +++++ .../intended/structured_configs/DC1-POD1-LEAF2B.yml | 7 +++++++ .../intended/structured_configs/DC1-POD2-SPINE2.yml | 7 +++++++ .../intended/structured_configs/DC1-SUPER-SPINE1.yml | 7 +++++++ .../intended/structured_configs/DC2-POD1-LEAF1A.yml | 7 +++++++ .../intended/structured_configs/DC2-POD1-SPINE2.yml | 7 +++++++ .../intended/structured_configs/DC2-SUPER-SPINE1.yml | 7 +++++++ 18 files changed, 102 insertions(+) diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md index 51901414dc5..da852c81ba7 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md @@ -359,6 +359,11 @@ interface Ethernet7 no switchport ip address 11.1.0.38/31 ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ! interface Ethernet11 description P2P_DC1-POD1-SPINE1_Ethernet8 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md index 0bcb11606b7..d45b29beb76 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md @@ -215,6 +215,11 @@ interface Ethernet4 no switchport ip address 200.200.200.101/24 ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ``` ### Loopback Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md index 6888c94e063..7383876048b 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md @@ -204,6 +204,11 @@ interface Ethernet6 ip address 11.1.2.0/31 mac security profile MACSEC_PROFILE ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ``` ### Loopback Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md index 1e0264a2bef..e37247d5ca3 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md @@ -263,6 +263,11 @@ interface Ethernet7 no switchport ip address 11.1.0.39/31 ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ``` ### Port-Channel Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md index 210db623f3d..95b9a4dfeae 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md @@ -219,6 +219,11 @@ interface Ethernet5 no switchport ip address 200.200.200.201/24 ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ``` ### Loopback Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md index d9f4c11a72b..542107ae774 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md @@ -215,6 +215,11 @@ interface Ethernet4 ip address 11.1.2.1/31 mac security profile MACSEC_PROFILE ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ! interface Ethernet5 description P2P_DC2-RS2_Ethernet1 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg index b3dd44286bf..ad0d02ff69d 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg @@ -178,6 +178,11 @@ interface Ethernet7 no switchport ip address 11.1.0.38/31 ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ! interface Ethernet11 description P2P_DC1-POD1-SPINE1_Ethernet8 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg index dd68564c565..b7d5e2d8066 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg @@ -58,6 +58,11 @@ interface Ethernet4 no switchport ip address 200.200.200.101/24 ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg index 4a33013d7db..149b7cb4328 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg @@ -75,6 +75,11 @@ interface Ethernet6 ip address 11.1.2.0/31 mac security profile MACSEC_PROFILE ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg index e2defc66107..e0a095ce697 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg @@ -79,6 +79,11 @@ interface Ethernet7 no switchport ip address 11.1.0.39/31 ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg index 57de23b9a86..cf3b05e5722 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg @@ -63,6 +63,11 @@ interface Ethernet5 no switchport ip address 200.200.200.201/24 ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg index 56072e92586..4e778bcf4c8 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg @@ -55,6 +55,11 @@ interface Ethernet4 ip address 11.1.2.1/31 mac security profile MACSEC_PROFILE ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ! interface Ethernet5 description P2P_DC2-RS2_Ethernet1 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml index f26c99dc6ab..040c5138e65 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml @@ -658,6 +658,13 @@ ethernet_interfaces: ip_address: 11.1.0.38/31 description: P2P_DC2-POD1-LEAF1A_Ethernet7 ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 enable: true - name: Ethernet16 peer: server-1 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml index 45ed1842ff8..471bbe83b64 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml @@ -172,6 +172,13 @@ ethernet_interfaces: ip_address: 200.200.200.101/24 description: P2P_DC2-POD1-SPINE2_Ethernet5 ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 enable: true loopback_interfaces: - name: Loopback0 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml index 159327fc021..89cc41fa89f 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml @@ -174,6 +174,13 @@ ethernet_interfaces: profile: MACSEC_PROFILE description: P2P_DC2-SUPER-SPINE1_Ethernet4 ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 enable: true loopback_interfaces: - name: Loopback0 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml index 48c8d5077ea..472d0012ea5 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml @@ -274,6 +274,13 @@ ethernet_interfaces: ip_address: 11.1.0.39/31 description: P2P_DC1-POD1-LEAF2B_Ethernet7 ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 enable: true port_channel_interfaces: - name: Port-Channel3 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml index c0b79d60b56..ca309b21c30 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml @@ -156,6 +156,13 @@ ethernet_interfaces: ip_address: 200.200.200.201/24 description: P2P_DC1-POD2-SPINE2_Ethernet4 ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 enable: true loopback_interfaces: - name: Loopback0 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml index 8a249940d24..683b34f88e9 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml @@ -223,6 +223,13 @@ ethernet_interfaces: profile: MACSEC_PROFILE description: P2P_DC1-SUPER-SPINE1_Ethernet6 ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 enable: true loopback_interfaces: - name: Loopback0 From 9c2303630c20ae1dfdf68e47307c1418420bfeda Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Mon, 21 Oct 2024 14:34:17 +0530 Subject: [PATCH 04/30] Handle ptp role --- .../documentation/devices/DC1-POD1-LEAF2B.md | 1 + .../documentation/devices/DC1-POD2-SPINE2.md | 1 + .../documentation/devices/DC1-SUPER-SPINE1.md | 1 + .../documentation/devices/DC2-POD1-LEAF1A.md | 1 + .../documentation/devices/DC2-POD1-SPINE2.md | 1 + .../documentation/devices/DC2-SUPER-SPINE1.md | 1 + .../intended/configs/DC1-POD1-LEAF2B.cfg | 1 + .../intended/configs/DC1-POD2-SPINE2.cfg | 1 + .../intended/configs/DC1-SUPER-SPINE1.cfg | 1 + .../intended/configs/DC2-POD1-LEAF1A.cfg | 1 + .../intended/configs/DC2-POD1-SPINE2.cfg | 1 + .../intended/configs/DC2-SUPER-SPINE1.cfg | 1 + .../intended/structured_configs/DC1-POD1-LEAF2B.yml | 1 + .../intended/structured_configs/DC1-POD2-SPINE2.yml | 1 + .../intended/structured_configs/DC1-SUPER-SPINE1.yml | 1 + .../intended/structured_configs/DC2-POD1-LEAF1A.yml | 1 + .../intended/structured_configs/DC2-POD1-SPINE2.yml | 1 + .../intended/structured_configs/DC2-SUPER-SPINE1.yml | 1 + .../intended/configs/custom-ptp-profile.cfg | 1 + .../eos_designs_unit_tests/intended/configs/l3_edge_bgp.cfg | 1 + .../eos_designs_unit_tests/intended/configs/l3_edge_isis.cfg | 1 + .../eos_designs_unit_tests/intended/configs/l3_edge_ospf.cfg | 1 + .../intended/configs/ptp-tests-spine1.cfg | 4 ++++ .../intended/configs/ptp-tests-spine2.cfg | 4 ++++ .../intended/structured_configs/custom-ptp-profile.yml | 1 + .../intended/structured_configs/l3_edge_bgp.yml | 1 + .../intended/structured_configs/l3_edge_isis.yml | 1 + .../intended/structured_configs/l3_edge_ospf.yml | 1 + .../intended/structured_configs/ptp-tests-spine1.yml | 4 ++++ .../intended/structured_configs/ptp-tests-spine2.yml | 4 ++++ .../structured_config/core_interfaces_and_l3_edge/utils.py | 4 ++++ 31 files changed, 46 insertions(+) diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md index da852c81ba7..9c36080cef8 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md @@ -362,6 +362,7 @@ interface Ethernet7 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md index d45b29beb76..cf73506101a 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md @@ -218,6 +218,7 @@ interface Ethernet4 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 ``` diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md index 7383876048b..54b32c086fc 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md @@ -207,6 +207,7 @@ interface Ethernet6 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 ``` diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md index e37247d5ca3..e6603025639 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md @@ -266,6 +266,7 @@ interface Ethernet7 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 ``` diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md index 95b9a4dfeae..6090e82f425 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md @@ -222,6 +222,7 @@ interface Ethernet5 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 ``` diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md index 542107ae774..c8d61a2ff65 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md @@ -218,6 +218,7 @@ interface Ethernet4 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg index ad0d02ff69d..4ab344c3468 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg @@ -181,6 +181,7 @@ interface Ethernet7 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg index b7d5e2d8066..5135952a739 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg @@ -61,6 +61,7 @@ interface Ethernet4 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg index 149b7cb4328..11518aac039 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg @@ -78,6 +78,7 @@ interface Ethernet6 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg index e0a095ce697..ebe81d1c979 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg @@ -82,6 +82,7 @@ interface Ethernet7 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg index cf3b05e5722..6f90d56fd08 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg @@ -66,6 +66,7 @@ interface Ethernet5 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg index 4e778bcf4c8..4ac8fbb3697 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg @@ -58,6 +58,7 @@ interface Ethernet4 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml index 040c5138e65..521876d3019 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml @@ -666,6 +666,7 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + role: master - name: Ethernet16 peer: server-1 peer_interface: Eth2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml index 471bbe83b64..fe8161fb3f8 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml @@ -180,6 +180,7 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + role: master loopback_interfaces: - name: Loopback0 description: ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml index 89cc41fa89f..9b90e50179b 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml @@ -182,6 +182,7 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + role: master loopback_interfaces: - name: Loopback0 description: ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml index 472d0012ea5..3ad15bbf7ff 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml @@ -282,6 +282,7 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + role: master port_channel_interfaces: - name: Port-Channel3 description: L2_DC2-POD1-L2LEAF1A_Port-Channel1 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml index ca309b21c30..ab85d009c08 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml @@ -164,6 +164,7 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + role: master loopback_interfaces: - name: Loopback0 description: ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml index 683b34f88e9..7e3e8229ae5 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml @@ -231,6 +231,7 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + role: master loopback_interfaces: - name: Loopback0 description: ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/custom-ptp-profile.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/custom-ptp-profile.cfg index ee1f5bb69a5..ffd2422958d 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/custom-ptp-profile.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/custom-ptp-profile.cfg @@ -46,6 +46,7 @@ interface Ethernet8 ptp announce interval 4 ptp announce timeout 3 ptp delay-req interval -6 + ptp role master ptp sync-message interval -7 ptp transport ipv4 ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_bgp.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_bgp.cfg index 07b5e727b4a..e362d5b807e 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_bgp.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_bgp.cfg @@ -47,6 +47,7 @@ interface ethernet1 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 service-policy type qos input TEST_POLICY diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_isis.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_isis.cfg index 5ef8312d6bb..d21e88a9491 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_isis.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_isis.cfg @@ -33,6 +33,7 @@ interface ethernet1 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 service-profile TEST-QOS-PROFILE diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_ospf.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_ospf.cfg index 1d21fc9811b..2daaf776254 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_ospf.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_ospf.cfg @@ -33,6 +33,7 @@ interface ethernet1 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 service-profile TEST-QOS-PROFILE diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine1.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine1.cfg index 1145a809124..dfbad8f8198 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine1.cfg @@ -95,6 +95,7 @@ interface Ethernet6 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 ! @@ -107,6 +108,7 @@ interface Ethernet7 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 ! @@ -119,6 +121,7 @@ interface Ethernet8 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 ! @@ -131,6 +134,7 @@ interface Ethernet9 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine2.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine2.cfg index 3f1d97728f7..7aa3f0b8c38 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine2.cfg @@ -51,6 +51,7 @@ interface Ethernet6 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 ! @@ -63,6 +64,7 @@ interface Ethernet7 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 ! @@ -75,6 +77,7 @@ interface Ethernet8 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 ! @@ -87,6 +90,7 @@ interface Ethernet9 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/custom-ptp-profile.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/custom-ptp-profile.yml index 9daa77e0615..125cf9ff3fe 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/custom-ptp-profile.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/custom-ptp-profile.yml @@ -150,6 +150,7 @@ ethernet_interfaces: interval: -7 transport: ipv4 enable: true + role: master vlans: - id: 11 name: VLAN11 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_bgp.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_bgp.yml index 2a98bc26724..5d3c93b5730 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_bgp.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_bgp.yml @@ -116,6 +116,7 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + role: master service_policy: qos: input: TEST_POLICY diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_isis.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_isis.yml index 5778cf3e450..7432131313c 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_isis.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_isis.yml @@ -62,6 +62,7 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + role: master - name: ethernet2 peer: peer2 peer_interface: ethernet2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_ospf.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_ospf.yml index cf447af509a..7dadf25a237 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_ospf.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_ospf.yml @@ -63,6 +63,7 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + role: master - name: ethernet2 peer: peer2 peer_interface: ethernet2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml index 3b32eeca7db..102f8d3b6c0 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml @@ -217,6 +217,7 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + role: master - name: Ethernet7 peer: ptp-tests-spine2 peer_interface: Ethernet7 @@ -235,6 +236,7 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + role: master - name: Ethernet8 peer: ptp-tests-spine2 peer_interface: Ethernet8 @@ -253,6 +255,7 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + role: master - name: Ethernet9 peer: ptp-tests-spine2 peer_interface: Ethernet9 @@ -271,6 +274,7 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + role: master loopback_interfaces: - name: Loopback0 description: ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml index 95361e29f9e..5dd31650b23 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml @@ -145,6 +145,7 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + role: master - name: Ethernet7 peer: ptp-tests-spine1 peer_interface: Ethernet7 @@ -163,6 +164,7 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + role: master - name: Ethernet8 peer: ptp-tests-spine1 peer_interface: Ethernet8 @@ -181,6 +183,7 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + role: master - name: Ethernet9 peer: ptp-tests-spine1 peer_interface: Ethernet9 @@ -199,5 +202,6 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + role: master metadata: platform: vEOS-LAB diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py index ec8b9a8a2dc..a1175062427 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py @@ -316,6 +316,10 @@ def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link ptp_config.update(self.shared_utils.ptp_profile) ptp_config["enable"] = True + + if get(p2p_link, "role") != "bmca": + ptp_config["role"] = "master" + ptp_config.pop("profile", None) ethernet_cfg["ptp"] = ptp_config From 042269c21fb30ceae1f6aaf2897bbd188cc96f88 Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Mon, 21 Oct 2024 15:02:02 +0530 Subject: [PATCH 05/30] Update error msg and add negative test --- ...e-p2p-links-ptp-profile-does-not-exist.yml | 29 +++++++++++++++++++ .../inventory/hosts.yml | 1 + .../core_interfaces_and_l3_edge/utils.py | 2 +- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/host_vars/failure-p2p-links-ptp-profile-does-not-exist.yml diff --git a/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/host_vars/failure-p2p-links-ptp-profile-does-not-exist.yml b/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/host_vars/failure-p2p-links-ptp-profile-does-not-exist.yml new file mode 100644 index 00000000000..826e6522a09 --- /dev/null +++ b/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/host_vars/failure-p2p-links-ptp-profile-does-not-exist.yml @@ -0,0 +1,29 @@ +--- +type: l3leaf + +ptp_profiles: + - profile: PROFILE-1 + +l3leaf: + defaults: + loopback_ipv4_pool: 10.254.1.0/27 + vtep_loopback_ipv4_pool: 10.254.11.0/27 + nodes: + - name: failure-p2p-links-ptp-profile-does-not-exist + id: 1 + bgp_as: 65101 + mgmt_ip: 192.168.0.101/24 + ptp: + enabled: true + +l3_edge: + p2p_links: + - nodes: [failure-p2p-links-ptp-profile-does-not-exist, not-in-fabric] + interfaces: [Ethernet10, Ethernet11] + ip: [192.168.0.2/31, 192.168.0.3/31] + ptp: + enabled: true + profile: PROFILE DOES NOT EXIST + +expected_error_message: >- + PTP Profile 'PROFILE DOES NOT EXIST' referenced under l3_edge.p2p_links does not exist in `ptp_profiles`. diff --git a/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/hosts.yml b/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/hosts.yml index 82134b2f75e..9ec68dcf98c 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/hosts.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/hosts.yml @@ -107,6 +107,7 @@ all: failure-missing-evpn-multicast-peg-rps: failure-missing-evpn-multicast-with-pim: failure-network-port-ptp-profile-does-not-exist: + failure-p2p-links-ptp-profile-does-not-exist: failure-no-local-path-group-in-default-policy: failure-adapter-ptp-profile-does-not-exist: failure-svi-grandparent-profile-does-not-exist: diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py index a1175062427..98254a79449 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py @@ -308,7 +308,7 @@ def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link ptp_config = {} if (ptp_profile_name := get(p2p_link, "ptp.profile", default=self.shared_utils.ptp_profile_name)) is not None: - msg = f"PTP Profile '{ptp_profile_name}' referenced under {context} does not exist in `ptp_profiles`." + msg = f"PTP Profile '{ptp_profile_name}' referenced under {context}.p2p_links does not exist in `ptp_profiles`." ptp_config.update(get_item(self.shared_utils.ptp_profiles, "profile", ptp_profile_name, required=True, custom_error_msg=msg)) # Apply PTP profile config From cbfe896c3e2a32d077bce425de0a9ee634370270 Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Fri, 25 Oct 2024 17:15:42 +0530 Subject: [PATCH 06/30] Remove context from ethernet_interfaces.py --- .../core_interfaces_and_l3_edge/ethernet_interfaces.py | 5 ++--- .../structured_config/core_interfaces_and_l3_edge/utils.py | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/ethernet_interfaces.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/ethernet_interfaces.py index 817854c1ad2..cc6e3bb6fd4 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/ethernet_interfaces.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/ethernet_interfaces.py @@ -30,10 +30,9 @@ def ethernet_interfaces(self: AvdStructuredConfigCoreInterfacesAndL3Edge) -> lis for p2p_link in self._filtered_p2p_links: if p2p_link["data"]["port_channel_id"] is None: # Ethernet interface - context = f"{self.data_model}" ethernet_interface = self._get_common_interface_cfg(p2p_link) ethernet_interface["description"] = self._p2p_link_ethernet_description(p2p_link) - ethernet_interface.update(self._get_ethernet_cfg(p2p_link, context)) + ethernet_interface.update(self._get_ethernet_cfg(p2p_link)) # Remove None values ethernet_interface = {key: value for key, value in ethernet_interface.items() if value is not None} @@ -50,7 +49,7 @@ def ethernet_interfaces(self: AvdStructuredConfigCoreInterfacesAndL3Edge) -> lis for member in p2p_link["data"]["port_channel_members"]: ethernet_interface = self._get_port_channel_member_cfg(p2p_link, member) ethernet_interface["description"] = self._port_channel_member_description(p2p_link, member) - ethernet_interface.update(self._get_ethernet_cfg(p2p_link, context)) + ethernet_interface.update(self._get_ethernet_cfg(p2p_link)) # Remove None values ethernet_interface = {key: value for key, value in ethernet_interface.items() if value is not None} diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py index 98254a79449..ac13e5b03d9 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py @@ -293,7 +293,7 @@ def _get_common_interface_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, return interface_cfg - def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link: dict, context: str) -> dict: + def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link: dict) -> dict: """ Return partial structured_config for one p2p_link. @@ -308,7 +308,7 @@ def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link ptp_config = {} if (ptp_profile_name := get(p2p_link, "ptp.profile", default=self.shared_utils.ptp_profile_name)) is not None: - msg = f"PTP Profile '{ptp_profile_name}' referenced under {context}.p2p_links does not exist in `ptp_profiles`." + msg = f"PTP Profile '{ptp_profile_name}' referenced under {self.data_model}.p2p_links does not exist in `ptp_profiles`." ptp_config.update(get_item(self.shared_utils.ptp_profiles, "profile", ptp_profile_name, required=True, custom_error_msg=msg)) # Apply PTP profile config From ec46b6aaaf581806bb816e8ae59197a818482afa Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Tue, 29 Oct 2024 17:39:04 +0530 Subject: [PATCH 07/30] Adding profile in ptp_profiles and fix the bugs observed --- .../documentation/devices/DC1-POD1-LEAF2B.md | 5 ----- .../documentation/devices/DC1-POD2-SPINE2.md | 5 ----- .../documentation/devices/DC1-SUPER-SPINE1.md | 5 ----- .../documentation/devices/DC2-POD1-LEAF1A.md | 5 ----- .../documentation/devices/DC2-POD1-SPINE2.md | 5 ----- .../documentation/devices/DC2-SUPER-SPINE1.md | 5 ----- .../intended/configs/DC1-POD1-LEAF2B.cfg | 5 ----- .../intended/configs/DC1-POD2-SPINE2.cfg | 5 ----- .../intended/configs/DC1-SUPER-SPINE1.cfg | 5 ----- .../intended/configs/DC2-POD1-LEAF1A.cfg | 5 ----- .../intended/configs/DC2-POD1-SPINE2.cfg | 5 ----- .../intended/configs/DC2-SUPER-SPINE1.cfg | 5 ----- .../structured_configs/DC1-POD1-LEAF2B.yml | 7 ------- .../structured_configs/DC1-POD2-SPINE2.yml | 7 ------- .../structured_configs/DC1-SUPER-SPINE1.yml | 7 ------- .../structured_configs/DC2-POD1-LEAF1A.yml | 7 ------- .../structured_configs/DC2-POD1-SPINE2.yml | 7 ------- .../structured_configs/DC2-SUPER-SPINE1.yml | 7 ------- .../intended/configs/l3_edge_bgp.cfg | 5 ----- .../intended/configs/l3_edge_isis.cfg | 5 ----- .../intended/configs/l3_edge_ospf.cfg | 5 ----- .../intended/configs/ptp-tests-spine1.cfg | 8 ++++---- .../intended/configs/ptp-tests-spine2.cfg | 8 ++++---- .../structured_configs/l3_edge_bgp.yml | 7 ------- .../structured_configs/l3_edge_isis.yml | 7 ------- .../structured_configs/l3_edge_ospf.yml | 7 ------- .../structured_configs/ptp-tests-spine1.yml | 8 ++++---- .../structured_configs/ptp-tests-spine2.yml | 8 ++++---- .../inventory/group_vars/PTP_TESTS.yml | 1 + .../inventory/host_vars/ptp-tests-spine1.yml | 18 ++++++++++++++++++ .../inventory/host_vars/ptp-tests-spine2.yml | 18 ++++++++++++++++++ .../core_interfaces_and_l3_edge/utils.py | 14 ++++++++------ 32 files changed, 61 insertions(+), 160 deletions(-) create mode 100644 ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/ptp-tests-spine1.yml create mode 100644 ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/ptp-tests-spine2.yml diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md index 9c36080cef8..3ff412bfcfd 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md @@ -359,12 +359,7 @@ interface Ethernet7 no switchport ip address 11.1.0.38/31 ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 ptp role master - ptp sync-message interval -3 - ptp transport ipv4 ! interface Ethernet11 description P2P_DC1-POD1-SPINE1_Ethernet8 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md index cf73506101a..6758e2c0306 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md @@ -215,12 +215,7 @@ interface Ethernet4 no switchport ip address 200.200.200.101/24 ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 ptp role master - ptp sync-message interval -3 - ptp transport ipv4 ``` ### Loopback Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md index 54b32c086fc..6202c0018fd 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md @@ -204,12 +204,7 @@ interface Ethernet6 ip address 11.1.2.0/31 mac security profile MACSEC_PROFILE ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 ptp role master - ptp sync-message interval -3 - ptp transport ipv4 ``` ### Loopback Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md index e6603025639..623ff21873f 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md @@ -263,12 +263,7 @@ interface Ethernet7 no switchport ip address 11.1.0.39/31 ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 ptp role master - ptp sync-message interval -3 - ptp transport ipv4 ``` ### Port-Channel Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md index 6090e82f425..74b316c02d8 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md @@ -219,12 +219,7 @@ interface Ethernet5 no switchport ip address 200.200.200.201/24 ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 ptp role master - ptp sync-message interval -3 - ptp transport ipv4 ``` ### Loopback Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md index c8d61a2ff65..3d61fb71232 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md @@ -215,12 +215,7 @@ interface Ethernet4 ip address 11.1.2.1/31 mac security profile MACSEC_PROFILE ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 ptp role master - ptp sync-message interval -3 - ptp transport ipv4 ! interface Ethernet5 description P2P_DC2-RS2_Ethernet1 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg index 4ab344c3468..b765f1ce8d1 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg @@ -178,12 +178,7 @@ interface Ethernet7 no switchport ip address 11.1.0.38/31 ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 ptp role master - ptp sync-message interval -3 - ptp transport ipv4 ! interface Ethernet11 description P2P_DC1-POD1-SPINE1_Ethernet8 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg index 5135952a739..85448387b14 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg @@ -58,12 +58,7 @@ interface Ethernet4 no switchport ip address 200.200.200.101/24 ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 ptp role master - ptp sync-message interval -3 - ptp transport ipv4 ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg index 11518aac039..a0f34d0d48e 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg @@ -75,12 +75,7 @@ interface Ethernet6 ip address 11.1.2.0/31 mac security profile MACSEC_PROFILE ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 ptp role master - ptp sync-message interval -3 - ptp transport ipv4 ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg index ebe81d1c979..98dffe0ce2a 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg @@ -79,12 +79,7 @@ interface Ethernet7 no switchport ip address 11.1.0.39/31 ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 ptp role master - ptp sync-message interval -3 - ptp transport ipv4 ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg index 6f90d56fd08..34dda495b71 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg @@ -63,12 +63,7 @@ interface Ethernet5 no switchport ip address 200.200.200.201/24 ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 ptp role master - ptp sync-message interval -3 - ptp transport ipv4 ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg index 4ac8fbb3697..04818ebf6ba 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg @@ -55,12 +55,7 @@ interface Ethernet4 ip address 11.1.2.1/31 mac security profile MACSEC_PROFILE ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 ptp role master - ptp sync-message interval -3 - ptp transport ipv4 ! interface Ethernet5 description P2P_DC2-RS2_Ethernet1 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml index 521876d3019..24d5497ae68 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml @@ -658,13 +658,6 @@ ethernet_interfaces: ip_address: 11.1.0.38/31 description: P2P_DC2-POD1-LEAF1A_Ethernet7 ptp: - announce: - interval: 0 - timeout: 3 - delay_req: -3 - sync_message: - interval: -3 - transport: ipv4 enable: true role: master - name: Ethernet16 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml index fe8161fb3f8..669699150b9 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml @@ -172,13 +172,6 @@ ethernet_interfaces: ip_address: 200.200.200.101/24 description: P2P_DC2-POD1-SPINE2_Ethernet5 ptp: - announce: - interval: 0 - timeout: 3 - delay_req: -3 - sync_message: - interval: -3 - transport: ipv4 enable: true role: master loopback_interfaces: diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml index 9b90e50179b..09e92ee070d 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml @@ -174,13 +174,6 @@ ethernet_interfaces: profile: MACSEC_PROFILE description: P2P_DC2-SUPER-SPINE1_Ethernet4 ptp: - announce: - interval: 0 - timeout: 3 - delay_req: -3 - sync_message: - interval: -3 - transport: ipv4 enable: true role: master loopback_interfaces: diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml index 3ad15bbf7ff..a2d4c871069 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml @@ -274,13 +274,6 @@ ethernet_interfaces: ip_address: 11.1.0.39/31 description: P2P_DC1-POD1-LEAF2B_Ethernet7 ptp: - announce: - interval: 0 - timeout: 3 - delay_req: -3 - sync_message: - interval: -3 - transport: ipv4 enable: true role: master port_channel_interfaces: diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml index ab85d009c08..69c6375673e 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml @@ -156,13 +156,6 @@ ethernet_interfaces: ip_address: 200.200.200.201/24 description: P2P_DC1-POD2-SPINE2_Ethernet4 ptp: - announce: - interval: 0 - timeout: 3 - delay_req: -3 - sync_message: - interval: -3 - transport: ipv4 enable: true role: master loopback_interfaces: diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml index 7e3e8229ae5..61e226c9ad3 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml @@ -223,13 +223,6 @@ ethernet_interfaces: profile: MACSEC_PROFILE description: P2P_DC1-SUPER-SPINE1_Ethernet6 ptp: - announce: - interval: 0 - timeout: 3 - delay_req: -3 - sync_message: - interval: -3 - transport: ipv4 enable: true role: master loopback_interfaces: diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_bgp.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_bgp.cfg index e362d5b807e..9de0fd0589f 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_bgp.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_bgp.cfg @@ -44,12 +44,7 @@ interface ethernet1 ip address 192.168.0.0/31 mac security profile TEST-MACSEC-PROFILE ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 ptp role master - ptp sync-message interval -3 - ptp transport ipv4 service-policy type qos input TEST_POLICY service-profile TEST-QOS-PROFILE ! TEST RAW_EOS_CLI diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_isis.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_isis.cfg index d21e88a9491..c9f13bf3b15 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_isis.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_isis.cfg @@ -30,12 +30,7 @@ interface ethernet1 ip address 192.168.0.0/31 mac security profile TEST-MACSEC-PROFILE ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 ptp role master - ptp sync-message interval -3 - ptp transport ipv4 service-profile TEST-QOS-PROFILE ! interface ethernet2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_ospf.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_ospf.cfg index 2daaf776254..744ddbe9220 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_ospf.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_ospf.cfg @@ -30,12 +30,7 @@ interface ethernet1 ip address 192.168.0.0/31 mac security profile TEST-MACSEC-PROFILE ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 ptp role master - ptp sync-message interval -3 - ptp transport ipv4 service-profile TEST-QOS-PROFILE ! interface ethernet2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine1.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine1.cfg index dfbad8f8198..81153c17f2e 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine1.cfg @@ -92,11 +92,11 @@ interface Ethernet6 mtu 9214 no switchport ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 + ptp announce interval 2 + ptp announce timeout 10 + ptp delay-req interval 2 ptp role master - ptp sync-message interval -3 + ptp sync-message interval 2 ptp transport ipv4 ! interface Ethernet7 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine2.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine2.cfg index 7aa3f0b8c38..a36764bd19a 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine2.cfg @@ -48,11 +48,11 @@ interface Ethernet6 mtu 9214 no switchport ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 + ptp announce interval 2 + ptp announce timeout 10 + ptp delay-req interval 2 ptp role master - ptp sync-message interval -3 + ptp sync-message interval 2 ptp transport ipv4 ! interface Ethernet7 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_bgp.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_bgp.yml index 5d3c93b5730..1a5145719c3 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_bgp.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_bgp.yml @@ -108,13 +108,6 @@ ethernet_interfaces: description: P2P_peer1_ethernet1 speed: forced 10000full ptp: - announce: - interval: 0 - timeout: 3 - delay_req: -3 - sync_message: - interval: -3 - transport: ipv4 enable: true role: master service_policy: diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_isis.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_isis.yml index 7432131313c..b60f835bde6 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_isis.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_isis.yml @@ -54,13 +54,6 @@ ethernet_interfaces: description: P2P_peer1_ethernet1 speed: forced 10000full ptp: - announce: - interval: 0 - timeout: 3 - delay_req: -3 - sync_message: - interval: -3 - transport: ipv4 enable: true role: master - name: ethernet2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_ospf.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_ospf.yml index 7dadf25a237..aeb6b7f5b02 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_ospf.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_ospf.yml @@ -55,13 +55,6 @@ ethernet_interfaces: description: P2P_peer1_ethernet1 speed: forced 10000full ptp: - announce: - interval: 0 - timeout: 3 - delay_req: -3 - sync_message: - interval: -3 - transport: ipv4 enable: true role: master - name: ethernet2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml index 102f8d3b6c0..dc9a02139cf 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml @@ -210,11 +210,11 @@ ethernet_interfaces: description: P2P_ptp-tests-spine2_Ethernet6 ptp: announce: - interval: 0 - timeout: 3 - delay_req: -3 + interval: 2 + timeout: 10 + delay_req: 2 sync_message: - interval: -3 + interval: 2 transport: ipv4 enable: true role: master diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml index 5dd31650b23..ef1b93c6e8f 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml @@ -138,11 +138,11 @@ ethernet_interfaces: description: P2P_ptp-tests-spine1_Ethernet6 ptp: announce: - interval: 0 - timeout: 3 - delay_req: -3 + interval: 2 + timeout: 10 + delay_req: 2 sync_message: - interval: -3 + interval: 2 transport: ipv4 enable: true role: master diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS.yml index c21d43b644f..da5130ad1f6 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS.yml @@ -14,6 +14,7 @@ core_interfaces: interfaces: [ Ethernet6, Ethernet6 ] ptp: enabled: true + profile: myptpprofile include_in_underlay_protocol: false - nodes: [ ptp-tests-spine1, ptp-tests-spine2 ] interfaces: [ Ethernet7, Ethernet7 ] diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/ptp-tests-spine1.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/ptp-tests-spine1.yml new file mode 100644 index 00000000000..c72a5aa10a0 --- /dev/null +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/ptp-tests-spine1.yml @@ -0,0 +1,18 @@ +--- +ptp_profiles: + - profile: myptpprofile + announce: + interval: 2 + timeout: 10 + delay_req: 2 + sync_message: + interval: 2 + transport: ipv4 + - profile: aes67-r16-2016 + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/ptp-tests-spine2.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/ptp-tests-spine2.yml new file mode 100644 index 00000000000..c72a5aa10a0 --- /dev/null +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/ptp-tests-spine2.yml @@ -0,0 +1,18 @@ +--- +ptp_profiles: + - profile: myptpprofile + announce: + interval: 2 + timeout: 10 + delay_req: 2 + sync_message: + interval: 2 + transport: ipv4 + - profile: aes67-r16-2016 + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py index ac13e5b03d9..6455592cf59 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py @@ -307,13 +307,15 @@ def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link ptp_config = {} - if (ptp_profile_name := get(p2p_link, "ptp.profile", default=self.shared_utils.ptp_profile_name)) is not None: - msg = f"PTP Profile '{ptp_profile_name}' referenced under {self.data_model}.p2p_links does not exist in `ptp_profiles`." - ptp_config.update(get_item(self.shared_utils.ptp_profiles, "profile", ptp_profile_name, required=True, custom_error_msg=msg)) - - # Apply PTP profile config if self.shared_utils.ptp_enabled: - ptp_config.update(self.shared_utils.ptp_profile) + # Apply PTP profile config from node settings when profile is not defined on p2p_link + if ptp_profile_name := get(p2p_link, "ptp.profile") is None: + ptp_config.update(self.shared_utils.ptp_profile) + + #Apply PTP profile defined for the p2p_link + if (ptp_profile_name := get(p2p_link, "ptp.profile", default=self.shared_utils.ptp_profile_name)) is not None: + msg = f"PTP Profile '{ptp_profile_name}' referenced under {self.data_model}.p2p_links does not exist in `ptp_profiles`." + ptp_config.update(get_item(self.shared_utils.ptp_profiles, "profile", ptp_profile_name, required=True, custom_error_msg=msg)) ptp_config["enable"] = True From ad9fc53864f688cf59acba856c458a3740b83317 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:12:01 +0000 Subject: [PATCH 08/30] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../structured_config/core_interfaces_and_l3_edge/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py index 6455592cf59..55ae8e682b4 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py @@ -312,7 +312,7 @@ def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link if ptp_profile_name := get(p2p_link, "ptp.profile") is None: ptp_config.update(self.shared_utils.ptp_profile) - #Apply PTP profile defined for the p2p_link + # Apply PTP profile defined for the p2p_link if (ptp_profile_name := get(p2p_link, "ptp.profile", default=self.shared_utils.ptp_profile_name)) is not None: msg = f"PTP Profile '{ptp_profile_name}' referenced under {self.data_model}.p2p_links does not exist in `ptp_profiles`." ptp_config.update(get_item(self.shared_utils.ptp_profiles, "profile", ptp_profile_name, required=True, custom_error_msg=msg)) From ae695be56d08efb230ececa0513671a741fc7309 Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Tue, 29 Oct 2024 20:13:13 +0530 Subject: [PATCH 09/30] Adding tests for ptp settings through p2p_links_profiles and ptp_profiles --- .../documentation/devices/DC1-POD1-LEAF2B.md | 2 -- .../documentation/devices/DC1-POD2-SPINE2.md | 2 -- .../documentation/devices/DC1-SUPER-SPINE1.md | 2 -- .../documentation/devices/DC2-POD1-LEAF1A.md | 2 -- .../documentation/devices/DC2-POD1-SPINE2.md | 2 -- .../documentation/devices/DC2-SUPER-SPINE1.md | 2 -- .../intended/configs/DC1-POD1-LEAF2B.cfg | 2 -- .../intended/configs/DC1-POD2-SPINE2.cfg | 2 -- .../intended/configs/DC1-SUPER-SPINE1.cfg | 2 -- .../intended/configs/DC2-POD1-LEAF1A.cfg | 2 -- .../intended/configs/DC2-POD1-SPINE2.cfg | 2 -- .../intended/configs/DC2-SUPER-SPINE1.cfg | 2 -- .../structured_configs/DC1-POD1-LEAF2B.yml | 3 -- .../structured_configs/DC1-POD2-SPINE2.yml | 3 -- .../structured_configs/DC1-SUPER-SPINE1.yml | 3 -- .../structured_configs/DC2-POD1-LEAF1A.yml | 3 -- .../structured_configs/DC2-POD1-SPINE2.yml | 3 -- .../structured_configs/DC2-SUPER-SPINE1.yml | 3 -- .../intended/configs/core-1-isis-sr-ldp.cfg | 20 +++++++++++++ .../structured_configs/core-1-isis-sr-ldp.yml | 28 +++++++++++++++++++ .../inventory/group_vars/CORE_UNIT_TESTS.yml | 2 ++ .../host_vars/core-1-isis-sr-ldp.yml | 2 ++ .../core_interfaces_and_l3_edge/utils.py | 12 ++++---- 23 files changed, 58 insertions(+), 48 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md index 3ff412bfcfd..59fa2c7c6d3 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md @@ -358,8 +358,6 @@ interface Ethernet7 no shutdown no switchport ip address 11.1.0.38/31 - ptp enable - ptp role master ! interface Ethernet11 description P2P_DC1-POD1-SPINE1_Ethernet8 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md index 6758e2c0306..f2edf158702 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md @@ -214,8 +214,6 @@ interface Ethernet4 no shutdown no switchport ip address 200.200.200.101/24 - ptp enable - ptp role master ``` ### Loopback Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md index 6202c0018fd..cbe2ef4bba4 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md @@ -203,8 +203,6 @@ interface Ethernet6 no switchport ip address 11.1.2.0/31 mac security profile MACSEC_PROFILE - ptp enable - ptp role master ``` ### Loopback Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md index 623ff21873f..8daa23590ea 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md @@ -262,8 +262,6 @@ interface Ethernet7 no shutdown no switchport ip address 11.1.0.39/31 - ptp enable - ptp role master ``` ### Port-Channel Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md index 74b316c02d8..a5709a8bca5 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md @@ -218,8 +218,6 @@ interface Ethernet5 no shutdown no switchport ip address 200.200.200.201/24 - ptp enable - ptp role master ``` ### Loopback Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md index 3d61fb71232..d8fffa764cb 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md @@ -214,8 +214,6 @@ interface Ethernet4 no switchport ip address 11.1.2.1/31 mac security profile MACSEC_PROFILE - ptp enable - ptp role master ! interface Ethernet5 description P2P_DC2-RS2_Ethernet1 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg index b765f1ce8d1..4c12ae97d71 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg @@ -177,8 +177,6 @@ interface Ethernet7 no shutdown no switchport ip address 11.1.0.38/31 - ptp enable - ptp role master ! interface Ethernet11 description P2P_DC1-POD1-SPINE1_Ethernet8 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg index 85448387b14..4262e89a266 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg @@ -57,8 +57,6 @@ interface Ethernet4 no shutdown no switchport ip address 200.200.200.101/24 - ptp enable - ptp role master ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg index a0f34d0d48e..a1e0a08a382 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg @@ -74,8 +74,6 @@ interface Ethernet6 no switchport ip address 11.1.2.0/31 mac security profile MACSEC_PROFILE - ptp enable - ptp role master ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg index 98dffe0ce2a..c6e6950c53c 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg @@ -78,8 +78,6 @@ interface Ethernet7 no shutdown no switchport ip address 11.1.0.39/31 - ptp enable - ptp role master ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg index 34dda495b71..6790768fd0c 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg @@ -62,8 +62,6 @@ interface Ethernet5 no shutdown no switchport ip address 200.200.200.201/24 - ptp enable - ptp role master ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg index 04818ebf6ba..0c620dc9b3e 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg @@ -54,8 +54,6 @@ interface Ethernet4 no switchport ip address 11.1.2.1/31 mac security profile MACSEC_PROFILE - ptp enable - ptp role master ! interface Ethernet5 description P2P_DC2-RS2_Ethernet1 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml index 24d5497ae68..938c9dfed19 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml @@ -657,9 +657,6 @@ ethernet_interfaces: shutdown: false ip_address: 11.1.0.38/31 description: P2P_DC2-POD1-LEAF1A_Ethernet7 - ptp: - enable: true - role: master - name: Ethernet16 peer: server-1 peer_interface: Eth2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml index 669699150b9..9c7e1d0a16c 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml @@ -171,9 +171,6 @@ ethernet_interfaces: shutdown: false ip_address: 200.200.200.101/24 description: P2P_DC2-POD1-SPINE2_Ethernet5 - ptp: - enable: true - role: master loopback_interfaces: - name: Loopback0 description: ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml index 09e92ee070d..816425c5a57 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml @@ -173,9 +173,6 @@ ethernet_interfaces: mac_security: profile: MACSEC_PROFILE description: P2P_DC2-SUPER-SPINE1_Ethernet4 - ptp: - enable: true - role: master loopback_interfaces: - name: Loopback0 description: ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml index a2d4c871069..b2ba2694c45 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml @@ -273,9 +273,6 @@ ethernet_interfaces: shutdown: false ip_address: 11.1.0.39/31 description: P2P_DC1-POD1-LEAF2B_Ethernet7 - ptp: - enable: true - role: master port_channel_interfaces: - name: Port-Channel3 description: L2_DC2-POD1-L2LEAF1A_Port-Channel1 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml index 69c6375673e..e095ed4b375 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml @@ -155,9 +155,6 @@ ethernet_interfaces: shutdown: false ip_address: 200.200.200.201/24 description: P2P_DC1-POD2-SPINE2_Ethernet4 - ptp: - enable: true - role: master loopback_interfaces: - name: Loopback0 description: ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml index 61e226c9ad3..70e8cedd77d 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml @@ -222,9 +222,6 @@ ethernet_interfaces: mac_security: profile: MACSEC_PROFILE description: P2P_DC1-SUPER-SPINE1_Ethernet6 - ptp: - enable: true - role: master loopback_interfaces: - name: Loopback0 description: ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-1-isis-sr-ldp.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-1-isis-sr-ldp.cfg index 8c44ae989cd..b15e4212169 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-1-isis-sr-ldp.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-1-isis-sr-ldp.cfg @@ -10,6 +10,19 @@ service routing protocols model multi-agent ! hostname core-1-isis-sr-ldp ! +ptp clock-identity 00:1C:73:7f:00:01 +ptp domain 127 +ptp mode boundary +ptp priority1 127 +ptp priority2 1 +ptp monitor threshold offset-from-master 250 +ptp monitor threshold mean-path-delay 1500 +ptp monitor sequence-id +ptp monitor threshold missing-message sync 3 sequence-ids +ptp monitor threshold missing-message follow-up 3 sequence-ids +ptp monitor threshold missing-message delay-resp 3 sequence-ids +ptp monitor threshold missing-message announce 3 sequence-ids +! spanning-tree mode none ! vrf instance MGMT @@ -192,6 +205,13 @@ interface Ethernet10 mpls ldp igp sync mpls ldp interface mpls ip + ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp role master + ptp sync-message interval -3 + ptp transport ipv4 isis enable CORE isis circuit-type level-2 isis metric 50 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml index a16989714d4..dcd0d4ac0d8 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml @@ -31,6 +31,24 @@ router_general: router_id: ipv4: 10.0.0.1 ipv6: 2000:1234:ffff:ffff::1 +ptp: + mode: boundary + clock_identity: 00:1C:73:7f:00:01 + priority1: 127 + priority2: 1 + domain: 127 + monitor: + enabled: true + threshold: + offset_from_master: 250 + mean_path_delay: 1500 + missing_message: + sequence_ids: + enabled: true + announce: 3 + delay_resp: 3 + follow_up: 3 + sync: 3 loopback_interfaces: - name: Loopback0 description: ROUTER_ID @@ -248,6 +266,16 @@ ethernet_interfaces: igp_sync: true description: P2P_LINK_TO_CORE-2-OSPF-LDP_Ethernet10 speed: forced 1000full + ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 + enable: true + role: master - name: Ethernet12 peer: core-2-ospf-ldp peer_interface: Ethernet12 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/CORE_UNIT_TESTS.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/CORE_UNIT_TESTS.yml index 9369c8e3ee3..2fad75887f8 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/CORE_UNIT_TESTS.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/CORE_UNIT_TESTS.yml @@ -77,6 +77,8 @@ core_interfaces: speed: "forced 1000full" mtu: 1500 ip_pool: underlay_pool + ptp: + enabled: true p2p_links: diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/core-1-isis-sr-ldp.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/core-1-isis-sr-ldp.yml index aeb92fa75ba..e4f7682d2c3 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/core-1-isis-sr-ldp.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/core-1-isis-sr-ldp.yml @@ -2,3 +2,5 @@ underlay_routing_protocol: isis-sr-ldp # Use router id from router general configuration use_router_general_for_router_id: true +ptp_settings: + enabled: true diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py index 55ae8e682b4..de38a410f9b 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py @@ -309,7 +309,7 @@ def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link if self.shared_utils.ptp_enabled: # Apply PTP profile config from node settings when profile is not defined on p2p_link - if ptp_profile_name := get(p2p_link, "ptp.profile") is None: + if get(p2p_link, "ptp.profile") is None: ptp_config.update(self.shared_utils.ptp_profile) # Apply PTP profile defined for the p2p_link @@ -317,13 +317,13 @@ def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link msg = f"PTP Profile '{ptp_profile_name}' referenced under {self.data_model}.p2p_links does not exist in `ptp_profiles`." ptp_config.update(get_item(self.shared_utils.ptp_profiles, "profile", ptp_profile_name, required=True, custom_error_msg=msg)) - ptp_config["enable"] = True + ptp_config["enable"] = True - if get(p2p_link, "role") != "bmca": - ptp_config["role"] = "master" + if get(p2p_link, "role") != "bmca": + ptp_config["role"] = "master" - ptp_config.pop("profile", None) - ethernet_cfg["ptp"] = ptp_config + ptp_config.pop("profile", None) + ethernet_cfg["ptp"] = ptp_config return ethernet_cfg From 76293c63a3947033c9f0d246352ce7f4197ea030 Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Wed, 30 Oct 2024 11:51:24 +0530 Subject: [PATCH 10/30] Fix --- .../documentation/devices/DC1-POD1-LEAF2B.md | 1 + .../documentation/devices/DC1-POD2-SPINE2.md | 1 + .../documentation/devices/DC1-SUPER-SPINE1.md | 1 + .../documentation/devices/DC2-POD1-LEAF1A.md | 1 + .../documentation/devices/DC2-POD1-SPINE2.md | 1 + .../documentation/devices/DC2-SUPER-SPINE1.md | 1 + .../intended/configs/DC1-POD1-LEAF2B.cfg | 1 + .../intended/configs/DC1-POD2-SPINE2.cfg | 1 + .../intended/configs/DC1-SUPER-SPINE1.cfg | 1 + .../intended/configs/DC2-POD1-LEAF1A.cfg | 1 + .../intended/configs/DC2-POD1-SPINE2.cfg | 1 + .../intended/configs/DC2-SUPER-SPINE1.cfg | 1 + .../intended/structured_configs/DC1-POD1-LEAF2B.yml | 2 ++ .../intended/structured_configs/DC1-POD2-SPINE2.yml | 2 ++ .../intended/structured_configs/DC1-SUPER-SPINE1.yml | 2 ++ .../intended/structured_configs/DC2-POD1-LEAF1A.yml | 2 ++ .../intended/structured_configs/DC2-POD1-SPINE2.yml | 2 ++ .../intended/structured_configs/DC2-SUPER-SPINE1.yml | 2 ++ .../intended/configs/core-2-ospf-ldp.cfg | 1 + .../intended/configs/l3_edge_bgp.cfg | 1 - .../intended/configs/l3_edge_isis.cfg | 1 - .../intended/configs/l3_edge_ospf.cfg | 1 - .../intended/structured_configs/core-1-isis-sr-ldp.yml | 2 +- .../intended/structured_configs/core-2-ospf-ldp.yml | 2 ++ .../intended/structured_configs/custom-ptp-profile.yml | 2 +- .../intended/structured_configs/l3_edge_bgp.yml | 1 - .../intended/structured_configs/l3_edge_isis.yml | 1 - .../intended/structured_configs/l3_edge_ospf.yml | 1 - .../intended/structured_configs/ptp-tests-spine1.yml | 8 ++++---- .../intended/structured_configs/ptp-tests-spine2.yml | 8 ++++---- .../core_interfaces_and_l3_edge/utils.py | 7 +++---- 31 files changed, 40 insertions(+), 20 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md index 59fa2c7c6d3..51901414dc5 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md @@ -358,6 +358,7 @@ interface Ethernet7 no shutdown no switchport ip address 11.1.0.38/31 + ptp enable ! interface Ethernet11 description P2P_DC1-POD1-SPINE1_Ethernet8 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md index f2edf158702..0bcb11606b7 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md @@ -214,6 +214,7 @@ interface Ethernet4 no shutdown no switchport ip address 200.200.200.101/24 + ptp enable ``` ### Loopback Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md index cbe2ef4bba4..6888c94e063 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md @@ -203,6 +203,7 @@ interface Ethernet6 no switchport ip address 11.1.2.0/31 mac security profile MACSEC_PROFILE + ptp enable ``` ### Loopback Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md index 8daa23590ea..1e0264a2bef 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md @@ -262,6 +262,7 @@ interface Ethernet7 no shutdown no switchport ip address 11.1.0.39/31 + ptp enable ``` ### Port-Channel Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md index a5709a8bca5..210db623f3d 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md @@ -218,6 +218,7 @@ interface Ethernet5 no shutdown no switchport ip address 200.200.200.201/24 + ptp enable ``` ### Loopback Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md index d8fffa764cb..d9f4c11a72b 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md @@ -214,6 +214,7 @@ interface Ethernet4 no switchport ip address 11.1.2.1/31 mac security profile MACSEC_PROFILE + ptp enable ! interface Ethernet5 description P2P_DC2-RS2_Ethernet1 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg index 4c12ae97d71..b3dd44286bf 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg @@ -177,6 +177,7 @@ interface Ethernet7 no shutdown no switchport ip address 11.1.0.38/31 + ptp enable ! interface Ethernet11 description P2P_DC1-POD1-SPINE1_Ethernet8 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg index 4262e89a266..dd68564c565 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg @@ -57,6 +57,7 @@ interface Ethernet4 no shutdown no switchport ip address 200.200.200.101/24 + ptp enable ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg index a1e0a08a382..4a33013d7db 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg @@ -74,6 +74,7 @@ interface Ethernet6 no switchport ip address 11.1.2.0/31 mac security profile MACSEC_PROFILE + ptp enable ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg index c6e6950c53c..e2defc66107 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg @@ -78,6 +78,7 @@ interface Ethernet7 no shutdown no switchport ip address 11.1.0.39/31 + ptp enable ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg index 6790768fd0c..57de23b9a86 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg @@ -62,6 +62,7 @@ interface Ethernet5 no shutdown no switchport ip address 200.200.200.201/24 + ptp enable ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg index 0c620dc9b3e..56072e92586 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg @@ -54,6 +54,7 @@ interface Ethernet4 no switchport ip address 11.1.2.1/31 mac security profile MACSEC_PROFILE + ptp enable ! interface Ethernet5 description P2P_DC2-RS2_Ethernet1 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml index 938c9dfed19..f26c99dc6ab 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml @@ -657,6 +657,8 @@ ethernet_interfaces: shutdown: false ip_address: 11.1.0.38/31 description: P2P_DC2-POD1-LEAF1A_Ethernet7 + ptp: + enable: true - name: Ethernet16 peer: server-1 peer_interface: Eth2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml index 9c7e1d0a16c..45ed1842ff8 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml @@ -171,6 +171,8 @@ ethernet_interfaces: shutdown: false ip_address: 200.200.200.101/24 description: P2P_DC2-POD1-SPINE2_Ethernet5 + ptp: + enable: true loopback_interfaces: - name: Loopback0 description: ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml index 816425c5a57..159327fc021 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml @@ -173,6 +173,8 @@ ethernet_interfaces: mac_security: profile: MACSEC_PROFILE description: P2P_DC2-SUPER-SPINE1_Ethernet4 + ptp: + enable: true loopback_interfaces: - name: Loopback0 description: ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml index b2ba2694c45..48c8d5077ea 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml @@ -273,6 +273,8 @@ ethernet_interfaces: shutdown: false ip_address: 11.1.0.39/31 description: P2P_DC1-POD1-LEAF2B_Ethernet7 + ptp: + enable: true port_channel_interfaces: - name: Port-Channel3 description: L2_DC2-POD1-L2LEAF1A_Port-Channel1 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml index e095ed4b375..c0b79d60b56 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml @@ -155,6 +155,8 @@ ethernet_interfaces: shutdown: false ip_address: 200.200.200.201/24 description: P2P_DC1-POD2-SPINE2_Ethernet4 + ptp: + enable: true loopback_interfaces: - name: Loopback0 description: ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml index 70e8cedd77d..8a249940d24 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml @@ -222,6 +222,8 @@ ethernet_interfaces: mac_security: profile: MACSEC_PROFILE description: P2P_DC1-SUPER-SPINE1_Ethernet6 + ptp: + enable: true loopback_interfaces: - name: Loopback0 description: ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-2-ospf-ldp.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-2-ospf-ldp.cfg index 1114402b5d6..b948c8f4b20 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-2-ospf-ldp.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-2-ospf-ldp.cfg @@ -152,6 +152,7 @@ interface Ethernet10 mpls ip ip ospf network point-to-point ip ospf area 0.0.0.0 + ptp enable ! interface Ethernet12 description P2P_LINK_TO_CORE-1-ISIS-SR-LDP_Ethernet12 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_bgp.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_bgp.cfg index 9de0fd0589f..4cfaba9b585 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_bgp.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_bgp.cfg @@ -44,7 +44,6 @@ interface ethernet1 ip address 192.168.0.0/31 mac security profile TEST-MACSEC-PROFILE ptp enable - ptp role master service-policy type qos input TEST_POLICY service-profile TEST-QOS-PROFILE ! TEST RAW_EOS_CLI diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_isis.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_isis.cfg index c9f13bf3b15..c1ff76a9de2 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_isis.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_isis.cfg @@ -30,7 +30,6 @@ interface ethernet1 ip address 192.168.0.0/31 mac security profile TEST-MACSEC-PROFILE ptp enable - ptp role master service-profile TEST-QOS-PROFILE ! interface ethernet2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_ospf.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_ospf.cfg index 744ddbe9220..762df9dc35f 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_ospf.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_ospf.cfg @@ -30,7 +30,6 @@ interface ethernet1 ip address 192.168.0.0/31 mac security profile TEST-MACSEC-PROFILE ptp enable - ptp role master service-profile TEST-QOS-PROFILE ! interface ethernet2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml index dcd0d4ac0d8..a3f6c2bd921 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml @@ -274,8 +274,8 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 - enable: true role: master + enable: true - name: Ethernet12 peer: core-2-ospf-ldp peer_interface: Ethernet12 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-2-ospf-ldp.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-2-ospf-ldp.yml index 2d5a037c490..29c2446b949 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-2-ospf-ldp.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-2-ospf-ldp.yml @@ -190,6 +190,8 @@ ethernet_interfaces: igp_sync: true description: P2P_LINK_TO_CORE-1-ISIS-SR-LDP_Ethernet10 speed: forced 1000full + ptp: + enable: true - name: Ethernet12 peer: core-1-isis-sr-ldp peer_interface: Ethernet12 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/custom-ptp-profile.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/custom-ptp-profile.yml index 125cf9ff3fe..83a15daab1c 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/custom-ptp-profile.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/custom-ptp-profile.yml @@ -149,8 +149,8 @@ ethernet_interfaces: sync_message: interval: -7 transport: ipv4 - enable: true role: master + enable: true vlans: - id: 11 name: VLAN11 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_bgp.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_bgp.yml index 1a5145719c3..c3ceb717a5f 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_bgp.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_bgp.yml @@ -109,7 +109,6 @@ ethernet_interfaces: speed: forced 10000full ptp: enable: true - role: master service_policy: qos: input: TEST_POLICY diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_isis.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_isis.yml index b60f835bde6..207a4a9a407 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_isis.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_isis.yml @@ -55,7 +55,6 @@ ethernet_interfaces: speed: forced 10000full ptp: enable: true - role: master - name: ethernet2 peer: peer2 peer_interface: ethernet2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_ospf.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_ospf.yml index aeb6b7f5b02..703e8a7d313 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_ospf.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_ospf.yml @@ -56,7 +56,6 @@ ethernet_interfaces: speed: forced 10000full ptp: enable: true - role: master - name: ethernet2 peer: peer2 peer_interface: ethernet2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml index dc9a02139cf..459377f6f2f 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml @@ -216,8 +216,8 @@ ethernet_interfaces: sync_message: interval: 2 transport: ipv4 - enable: true role: master + enable: true - name: Ethernet7 peer: ptp-tests-spine2 peer_interface: Ethernet7 @@ -235,8 +235,8 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 - enable: true role: master + enable: true - name: Ethernet8 peer: ptp-tests-spine2 peer_interface: Ethernet8 @@ -254,8 +254,8 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 - enable: true role: master + enable: true - name: Ethernet9 peer: ptp-tests-spine2 peer_interface: Ethernet9 @@ -273,8 +273,8 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 - enable: true role: master + enable: true loopback_interfaces: - name: Loopback0 description: ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml index ef1b93c6e8f..97a0b03fa93 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml @@ -144,8 +144,8 @@ ethernet_interfaces: sync_message: interval: 2 transport: ipv4 - enable: true role: master + enable: true - name: Ethernet7 peer: ptp-tests-spine1 peer_interface: Ethernet7 @@ -163,8 +163,8 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 - enable: true role: master + enable: true - name: Ethernet8 peer: ptp-tests-spine1 peer_interface: Ethernet8 @@ -182,8 +182,8 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 - enable: true role: master + enable: true - name: Ethernet9 peer: ptp-tests-spine1 peer_interface: Ethernet9 @@ -201,7 +201,7 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 - enable: true role: master + enable: true metadata: platform: vEOS-LAB diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py index de38a410f9b..07a9074b2ce 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py @@ -317,13 +317,12 @@ def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link msg = f"PTP Profile '{ptp_profile_name}' referenced under {self.data_model}.p2p_links does not exist in `ptp_profiles`." ptp_config.update(get_item(self.shared_utils.ptp_profiles, "profile", ptp_profile_name, required=True, custom_error_msg=msg)) - ptp_config["enable"] = True - if get(p2p_link, "role") != "bmca": ptp_config["role"] = "master" - ptp_config.pop("profile", None) - ethernet_cfg["ptp"] = ptp_config + ptp_config["enable"] = True + ptp_config.pop("profile", None) + ethernet_cfg["ptp"] = ptp_config return ethernet_cfg From 1eef9acb7e1ae3193a05ce83ea444a4ffa667f0a Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Fri, 15 Nov 2024 11:54:35 +0530 Subject: [PATCH 11/30] Fix CI. --- .../intended/structured_configs/core-1-isis-sr-ldp.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml index a3f6c2bd921..9306b4958e3 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml @@ -27,10 +27,6 @@ management_api_http: enable_vrfs: - name: MGMT enable_https: true -router_general: - router_id: - ipv4: 10.0.0.1 - ipv6: 2000:1234:ffff:ffff::1 ptp: mode: boundary clock_identity: 00:1C:73:7f:00:01 @@ -49,6 +45,10 @@ ptp: delay_resp: 3 follow_up: 3 sync: 3 +router_general: + router_id: + ipv4: 10.0.0.1 + ipv6: 2000:1234:ffff:ffff::1 loopback_interfaces: - name: Loopback0 description: ROUTER_ID From 3ac2b0d45e11083066ba211861edd3d42729b7e8 Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Fri, 15 Nov 2024 12:23:57 +0530 Subject: [PATCH 12/30] Correct code for role settings --- .../intended/configs/core-1-isis-sr-ldp.cfg | 2 +- .../intended/configs/custom-ptp-profile.cfg | 2 +- .../intended/configs/ptp-tests-spine1.cfg | 8 ++++---- .../intended/configs/ptp-tests-spine2.cfg | 8 ++++---- .../structured_configs/core-1-isis-sr-ldp.yml | 2 +- .../structured_configs/custom-ptp-profile.yml | 2 +- .../intended/structured_configs/ptp-tests-spine1.yml | 8 ++++---- .../intended/structured_configs/ptp-tests-spine2.yml | 8 ++++---- .../inventory/group_vars/PTP_TESTS.yml | 1 + .../roles/eos_designs/docs/tables/core-interfaces.md | 12 ++++++++---- .../avd/roles/eos_designs/docs/tables/l3-edge.md | 12 ++++++++---- .../pyavd/_eos_designs/schema/eos_designs.schema.yml | 12 ++++++++++++ .../schema_fragments/defs_p2p_links.schema.yml | 5 +++-- .../core_interfaces_and_l3_edge/utils.py | 4 ++-- 14 files changed, 54 insertions(+), 32 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-1-isis-sr-ldp.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-1-isis-sr-ldp.cfg index b15e4212169..5a56f73a071 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-1-isis-sr-ldp.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-1-isis-sr-ldp.cfg @@ -209,7 +209,7 @@ interface Ethernet10 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 - ptp role master + ptp role dynamic ptp sync-message interval -3 ptp transport ipv4 isis enable CORE diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/custom-ptp-profile.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/custom-ptp-profile.cfg index ffd2422958d..cff3eaa602a 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/custom-ptp-profile.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/custom-ptp-profile.cfg @@ -46,7 +46,7 @@ interface Ethernet8 ptp announce interval 4 ptp announce timeout 3 ptp delay-req interval -6 - ptp role master + ptp role dynamic ptp sync-message interval -7 ptp transport ipv4 ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine1.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine1.cfg index 81153c17f2e..a780aa87279 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine1.cfg @@ -95,7 +95,7 @@ interface Ethernet6 ptp announce interval 2 ptp announce timeout 10 ptp delay-req interval 2 - ptp role master + ptp role dynamic ptp sync-message interval 2 ptp transport ipv4 ! @@ -108,7 +108,7 @@ interface Ethernet7 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 - ptp role master + ptp role dynamic ptp sync-message interval -3 ptp transport ipv4 ! @@ -121,7 +121,7 @@ interface Ethernet8 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 - ptp role master + ptp role dynamic ptp sync-message interval -3 ptp transport ipv4 ! @@ -134,7 +134,7 @@ interface Ethernet9 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 - ptp role master + ptp role dynamic ptp sync-message interval -3 ptp transport ipv4 ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine2.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine2.cfg index a36764bd19a..3bf96d4d2ed 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine2.cfg @@ -51,7 +51,7 @@ interface Ethernet6 ptp announce interval 2 ptp announce timeout 10 ptp delay-req interval 2 - ptp role master + ptp role dynamic ptp sync-message interval 2 ptp transport ipv4 ! @@ -64,7 +64,7 @@ interface Ethernet7 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 - ptp role master + ptp role dynamic ptp sync-message interval -3 ptp transport ipv4 ! @@ -77,7 +77,7 @@ interface Ethernet8 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 - ptp role master + ptp role dynamic ptp sync-message interval -3 ptp transport ipv4 ! @@ -90,7 +90,7 @@ interface Ethernet9 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 - ptp role master + ptp role dynamic ptp sync-message interval -3 ptp transport ipv4 ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml index 9306b4958e3..ad71c29fec8 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml @@ -274,7 +274,7 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 - role: master + role: dynamic enable: true - name: Ethernet12 peer: core-2-ospf-ldp diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/custom-ptp-profile.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/custom-ptp-profile.yml index 83a15daab1c..065808a9241 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/custom-ptp-profile.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/custom-ptp-profile.yml @@ -149,7 +149,7 @@ ethernet_interfaces: sync_message: interval: -7 transport: ipv4 - role: master + role: dynamic enable: true vlans: - id: 11 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml index 459377f6f2f..20392e6d371 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml @@ -216,7 +216,7 @@ ethernet_interfaces: sync_message: interval: 2 transport: ipv4 - role: master + role: dynamic enable: true - name: Ethernet7 peer: ptp-tests-spine2 @@ -235,7 +235,7 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 - role: master + role: dynamic enable: true - name: Ethernet8 peer: ptp-tests-spine2 @@ -254,7 +254,7 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 - role: master + role: dynamic enable: true - name: Ethernet9 peer: ptp-tests-spine2 @@ -273,7 +273,7 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 - role: master + role: dynamic enable: true loopback_interfaces: - name: Loopback0 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml index 97a0b03fa93..a35be3c0b0a 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml @@ -144,7 +144,7 @@ ethernet_interfaces: sync_message: interval: 2 transport: ipv4 - role: master + role: dynamic enable: true - name: Ethernet7 peer: ptp-tests-spine1 @@ -163,7 +163,7 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 - role: master + role: dynamic enable: true - name: Ethernet8 peer: ptp-tests-spine1 @@ -182,7 +182,7 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 - role: master + role: dynamic enable: true - name: Ethernet9 peer: ptp-tests-spine1 @@ -201,7 +201,7 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 - role: master + role: dynamic enable: true metadata: platform: vEOS-LAB diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS.yml index da5130ad1f6..80bb5c52333 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS.yml @@ -20,6 +20,7 @@ core_interfaces: interfaces: [ Ethernet7, Ethernet7 ] ptp: enabled: true + role: dynamic include_in_underlay_protocol: false # Testing the same as above with l3_edge diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md index be55d7935cb..8861687b61c 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md @@ -42,7 +42,7 @@ | [      bfd](## "core_interfaces.p2p_links_profiles.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "core_interfaces.p2p_links_profiles.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "core_interfaces.p2p_links_profiles.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | - | [        role](## "core_interfaces.p2p_links_profiles.[].ptp.role") | String | | `bmca` | Valid Values:
- bmca
- master | | + | [        role](## "core_interfaces.p2p_links_profiles.[].ptp.role") | String | | `dynamic` | Valid Values:
- dynamic
- master | AVD and EOS default is `dynamic`. | | [        profile](## "core_interfaces.p2p_links_profiles.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "core_interfaces.p2p_links_profiles.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "core_interfaces.p2p_links_profiles.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | @@ -92,7 +92,7 @@ | [      bfd](## "core_interfaces.p2p_links.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "core_interfaces.p2p_links.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "core_interfaces.p2p_links.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | - | [        role](## "core_interfaces.p2p_links.[].ptp.role") | String | | `bmca` | Valid Values:
- bmca
- master | | + | [        role](## "core_interfaces.p2p_links.[].ptp.role") | String | | `dynamic` | Valid Values:
- dynamic
- master | AVD and EOS default is `dynamic`. | | [        profile](## "core_interfaces.p2p_links.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "core_interfaces.p2p_links.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "core_interfaces.p2p_links.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | @@ -217,7 +217,9 @@ # Enable PTP. enabled: - role: + + # AVD and EOS default is `dynamic`. + role: # Default available profiles are: # - "aes67" @@ -370,7 +372,9 @@ # Enable PTP. enabled: - role: + + # AVD and EOS default is `dynamic`. + role: # Default available profiles are: # - "aes67" diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md index 4ebe4105976..9a11d0ec7f6 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md @@ -42,7 +42,7 @@ | [      bfd](## "l3_edge.p2p_links_profiles.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "l3_edge.p2p_links_profiles.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "l3_edge.p2p_links_profiles.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | - | [        role](## "l3_edge.p2p_links_profiles.[].ptp.role") | String | | `bmca` | Valid Values:
- bmca
- master | | + | [        role](## "l3_edge.p2p_links_profiles.[].ptp.role") | String | | `dynamic` | Valid Values:
- dynamic
- master | AVD and EOS default is `dynamic`. | | [        profile](## "l3_edge.p2p_links_profiles.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "l3_edge.p2p_links_profiles.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "l3_edge.p2p_links_profiles.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | @@ -92,7 +92,7 @@ | [      bfd](## "l3_edge.p2p_links.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "l3_edge.p2p_links.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "l3_edge.p2p_links.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | - | [        role](## "l3_edge.p2p_links.[].ptp.role") | String | | `bmca` | Valid Values:
- bmca
- master | | + | [        role](## "l3_edge.p2p_links.[].ptp.role") | String | | `dynamic` | Valid Values:
- dynamic
- master | AVD and EOS default is `dynamic`. | | [        profile](## "l3_edge.p2p_links.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "l3_edge.p2p_links.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "l3_edge.p2p_links.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | @@ -217,7 +217,9 @@ # Enable PTP. enabled: - role: + + # AVD and EOS default is `dynamic`. + role: # Default available profiles are: # - "aes67" @@ -370,7 +372,9 @@ # Enable PTP. enabled: - role: + + # AVD and EOS default is `dynamic`. + role: # Default available profiles are: # - "aes67" diff --git a/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml b/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml index 7976fbf3581..d6c4116b7e0 100644 --- a/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml @@ -9643,6 +9643,18 @@ $defs: type: bool default: false description: Enable PTP. + role: + type: str + description: AVD and EOS default is `dynamic`. + default: dynamic + valid_values: + - dynamic + - master + profile: + type: str + default: aes67-r16-2016 + description: "Default available profiles are:\n - \"aes67\"\n - \"aes67-r16-2016\"\n + \ - \"smpte2059-2\"" sflow: type: bool description: Enable sFlow. Overrides `fabric_sflow` setting. diff --git a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml index d06b025ff05..6b04fbdd8aa 100644 --- a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml @@ -134,9 +134,10 @@ $defs: description: Enable PTP. role: type: str - default: "bmca" + description: AVD and EOS default is `dynamic`. + default: "dynamic" valid_values: - - "bmca" + - "dynamic" - "master" profile: type: str diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py index 07a9074b2ce..757a6cef3ac 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py @@ -317,8 +317,8 @@ def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link msg = f"PTP Profile '{ptp_profile_name}' referenced under {self.data_model}.p2p_links does not exist in `ptp_profiles`." ptp_config.update(get_item(self.shared_utils.ptp_profiles, "profile", ptp_profile_name, required=True, custom_error_msg=msg)) - if get(p2p_link, "role") != "bmca": - ptp_config["role"] = "master" + if ptp_role := get(p2p_link, "ptp.role", default="dynamic"): + ptp_config["role"] = ptp_role ptp_config["enable"] = True ptp_config.pop("profile", None) From 712dd670222936b4d3c1b826f2872ccb3dfdc71c Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Fri, 15 Nov 2024 12:45:55 +0530 Subject: [PATCH 13/30] Replace bmca to dynamic in connected endpoints role --- .../intended/configs/ptp-tests-leaf1.cfg | 2 +- .../intended/structured_configs/ptp-tests-leaf1.yml | 6 +++--- .../inventory/group_vars/PTP_TESTS.yml | 8 ++++---- .../roles/eos_designs/docs/tables/connected-endpoints.md | 6 ++++-- .../avd/roles/eos_designs/docs/tables/network-ports.md | 6 ++++-- .../avd/roles/eos_designs/docs/tables/port-profiles.md | 6 ++++-- .../pyavd/_eos_designs/schema/eos_designs.schema.yml | 2 ++ .../schema_fragments/defs_adapter_config.schema.yml | 2 ++ .../structured_config/connected_endpoints/utils.py | 2 +- 9 files changed, 25 insertions(+), 15 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-leaf1.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-leaf1.cfg index 4d30b44ee00..a733181d4b7 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-leaf1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-leaf1.cfg @@ -193,7 +193,7 @@ interface Ethernet12 channel-group 12 mode active ! interface Ethernet13 - description SERVER_bmca-endpoint_eth1 + description SERVER_dynamic-endpoint_eth1 no shutdown switchport access vlan 11 switchport mode access diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-leaf1.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-leaf1.yml index ea3eee408f2..76a1308679e 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-leaf1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-leaf1.yml @@ -359,11 +359,11 @@ ethernet_interfaces: id: 14 mode: active - name: Ethernet13 - peer: bmca-endpoint + peer: dynamic-endpoint peer_interface: eth1 peer_type: server - port_profile: PTP-profile-BMCA - description: SERVER_bmca-endpoint_eth1 + port_profile: PTP-profile-dynamic + description: SERVER_dynamic-endpoint_eth1 shutdown: false switchport: enabled: true diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS.yml index 80bb5c52333..583211dcf0c 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS.yml @@ -61,20 +61,20 @@ tenants: ip_address: 172.17.11.1/24 port_profiles: - - profile: PTP-profile-BMCA + - profile: PTP-profile-dynamic vlans: 11 mode: access ptp: enabled: true - endpoint_role: bmca + endpoint_role: dynamic servers: - - name: bmca-endpoint + - name: dynamic-endpoint adapters: - endpoint_ports: [ eth1 ] switch_ports: [ Ethernet13 ] switches: [ ptp-tests-leaf1 ] - profile: PTP-profile-BMCA + profile: PTP-profile-dynamic - name: video-endpoint adapters: diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/connected-endpoints.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/connected-endpoints.md index b3ff11d4e76..5555021709a 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/connected-endpoints.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/connected-endpoints.md @@ -41,7 +41,7 @@ | [        qos_profile](## ".[].adapters.[].qos_profile") | String | | | | QOS profile name. | | [        ptp](## ".[].adapters.[].ptp") | Dictionary | | | | The global PTP profile parameters will be applied to all connected endpoints where `ptp` is manually enabled.
`ptp role master` is set to ensure control over the PTP topology.
| | [          enabled](## ".[].adapters.[].ptp.enabled") | Boolean | | `False` | | | - | [          endpoint_role](## ".[].adapters.[].ptp.endpoint_role") | String | | `follower` | Valid Values:
- bmca
- default
- follower | | + | [          endpoint_role](## ".[].adapters.[].ptp.endpoint_role") | String | | `follower` | Valid Values:
- bmca
- default
- follower
- dynamic | Set `dynamic` instead of `bmca`(deprecated). | | [          profile](## ".[].adapters.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [        sflow](## ".[].adapters.[].sflow") | Boolean | | | | Configures sFlow on the interface. Overrides `fabric_sflow.endpoints` setting. | | [        flow_tracking](## ".[].adapters.[].flow_tracking") | Dictionary | | | | Configures flow-tracking on the interface. Overrides `fabric_flow_tracking.endpoints` setting. | @@ -300,7 +300,9 @@ # `ptp role master` is set to ensure control over the PTP topology. ptp: enabled: - endpoint_role: + + # Set `dynamic` instead of `bmca`(deprecated). + endpoint_role: # Default available profiles are: # - "aes67" diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/network-ports.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/network-ports.md index 355bf327783..4bf6f3311b1 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/network-ports.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/network-ports.md @@ -36,7 +36,7 @@ | [    qos_profile](## "network_ports.[].qos_profile") | String | | | | QOS profile name. | | [    ptp](## "network_ports.[].ptp") | Dictionary | | | | The global PTP profile parameters will be applied to all connected endpoints where `ptp` is manually enabled.
`ptp role master` is set to ensure control over the PTP topology.
| | [      enabled](## "network_ports.[].ptp.enabled") | Boolean | | `False` | | | - | [      endpoint_role](## "network_ports.[].ptp.endpoint_role") | String | | `follower` | Valid Values:
- bmca
- default
- follower | | + | [      endpoint_role](## "network_ports.[].ptp.endpoint_role") | String | | `follower` | Valid Values:
- bmca
- default
- follower
- dynamic | Set `dynamic` instead of `bmca`(deprecated). | | [      profile](## "network_ports.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [    sflow](## "network_ports.[].sflow") | Boolean | | | | Configures sFlow on the interface. Overrides `fabric_sflow.endpoints` setting. | | [    flow_tracking](## "network_ports.[].flow_tracking") | Dictionary | | | | Configures flow-tracking on the interface. Overrides `fabric_flow_tracking.endpoints` setting. | @@ -274,7 +274,9 @@ # `ptp role master` is set to ensure control over the PTP topology. ptp: enabled: - endpoint_role: + + # Set `dynamic` instead of `bmca`(deprecated). + endpoint_role: # Default available profiles are: # - "aes67" diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/port-profiles.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/port-profiles.md index a71c88ee66d..3d5a612c335 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/port-profiles.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/port-profiles.md @@ -32,7 +32,7 @@ | [    qos_profile](## "port_profiles.[].qos_profile") | String | | | | QOS profile name. | | [    ptp](## "port_profiles.[].ptp") | Dictionary | | | | The global PTP profile parameters will be applied to all connected endpoints where `ptp` is manually enabled.
`ptp role master` is set to ensure control over the PTP topology.
| | [      enabled](## "port_profiles.[].ptp.enabled") | Boolean | | `False` | | | - | [      endpoint_role](## "port_profiles.[].ptp.endpoint_role") | String | | `follower` | Valid Values:
- bmca
- default
- follower | | + | [      endpoint_role](## "port_profiles.[].ptp.endpoint_role") | String | | `follower` | Valid Values:
- bmca
- default
- follower
- dynamic | Set `dynamic` instead of `bmca`(deprecated). | | [      profile](## "port_profiles.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [    sflow](## "port_profiles.[].sflow") | Boolean | | | | Configures sFlow on the interface. Overrides `fabric_sflow.endpoints` setting. | | [    flow_tracking](## "port_profiles.[].flow_tracking") | Dictionary | | | | Configures flow-tracking on the interface. Overrides `fabric_flow_tracking.endpoints` setting. | @@ -255,7 +255,9 @@ # `ptp role master` is set to ensure control over the PTP topology. ptp: enabled: - endpoint_role: + + # Set `dynamic` instead of `bmca`(deprecated). + endpoint_role: # Default available profiles are: # - "aes67" diff --git a/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml b/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml index d6c4116b7e0..2e03ee0f946 100644 --- a/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml @@ -5264,11 +5264,13 @@ $defs: default: false endpoint_role: type: str + description: Set `dynamic` instead of `bmca`(deprecated). default: follower valid_values: - bmca - default - follower + - dynamic profile: type: str default: aes67-r16-2016 diff --git a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_adapter_config.schema.yml b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_adapter_config.schema.yml index cfc5883f5bf..03db5d1a664 100644 --- a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_adapter_config.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_adapter_config.schema.yml @@ -135,11 +135,13 @@ $defs: default: false endpoint_role: type: str + description: Set `dynamic` instead of `bmca`(deprecated). default: "follower" valid_values: - "bmca" - "default" - "follower" + - "dynamic" profile: type: str default: "aes67-r16-2016" diff --git a/python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/utils.py b/python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/utils.py index 06aaa2487de..f68f069f68e 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/utils.py @@ -213,7 +213,7 @@ def _get_adapter_ptp(self: AvdStructuredConfigConnectedEndpoints, adapter: dict) ptp_config["enable"] = True - if get(adapter, "ptp.endpoint_role") != "bmca": + if get(adapter, "ptp.endpoint_role") != "dynamic": ptp_config["role"] = "master" ptp_config.pop("profile", None) From abb0cdd8ae8b5cc175f521f2f3ec01f1e6a0d90b Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Fri, 15 Nov 2024 13:13:49 +0530 Subject: [PATCH 14/30] Remove ptp role dynamic from output --- .../intended/configs/core-1-isis-sr-ldp.cfg | 1 - .../intended/configs/custom-ptp-profile.cfg | 1 - .../intended/configs/ptp-tests-spine1.cfg | 4 ---- .../intended/configs/ptp-tests-spine2.cfg | 4 ---- .../structured_configs/core-1-isis-sr-ldp.yml | 1 - .../structured_configs/custom-ptp-profile.yml | 1 - .../intended/structured_configs/ptp-tests-spine1.yml | 4 ---- .../intended/structured_configs/ptp-tests-spine2.yml | 4 ---- .../roles/eos_designs/docs/tables/core-interfaces.md | 12 ++++++------ .../avd/roles/eos_designs/docs/tables/l3-edge.md | 12 ++++++------ .../pyavd/_eos_designs/schema/eos_designs.schema.yml | 3 +-- .../schema_fragments/defs_p2p_links.schema.yml | 3 +-- .../core_interfaces_and_l3_edge/utils.py | 4 ++-- 13 files changed, 16 insertions(+), 38 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-1-isis-sr-ldp.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-1-isis-sr-ldp.cfg index 5a56f73a071..9a28b2e22d1 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-1-isis-sr-ldp.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-1-isis-sr-ldp.cfg @@ -209,7 +209,6 @@ interface Ethernet10 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 - ptp role dynamic ptp sync-message interval -3 ptp transport ipv4 isis enable CORE diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/custom-ptp-profile.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/custom-ptp-profile.cfg index cff3eaa602a..ee1f5bb69a5 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/custom-ptp-profile.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/custom-ptp-profile.cfg @@ -46,7 +46,6 @@ interface Ethernet8 ptp announce interval 4 ptp announce timeout 3 ptp delay-req interval -6 - ptp role dynamic ptp sync-message interval -7 ptp transport ipv4 ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine1.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine1.cfg index a780aa87279..123c04b516b 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine1.cfg @@ -95,7 +95,6 @@ interface Ethernet6 ptp announce interval 2 ptp announce timeout 10 ptp delay-req interval 2 - ptp role dynamic ptp sync-message interval 2 ptp transport ipv4 ! @@ -108,7 +107,6 @@ interface Ethernet7 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 - ptp role dynamic ptp sync-message interval -3 ptp transport ipv4 ! @@ -121,7 +119,6 @@ interface Ethernet8 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 - ptp role dynamic ptp sync-message interval -3 ptp transport ipv4 ! @@ -134,7 +131,6 @@ interface Ethernet9 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 - ptp role dynamic ptp sync-message interval -3 ptp transport ipv4 ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine2.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine2.cfg index 3bf96d4d2ed..fc956cf3905 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine2.cfg @@ -51,7 +51,6 @@ interface Ethernet6 ptp announce interval 2 ptp announce timeout 10 ptp delay-req interval 2 - ptp role dynamic ptp sync-message interval 2 ptp transport ipv4 ! @@ -64,7 +63,6 @@ interface Ethernet7 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 - ptp role dynamic ptp sync-message interval -3 ptp transport ipv4 ! @@ -77,7 +75,6 @@ interface Ethernet8 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 - ptp role dynamic ptp sync-message interval -3 ptp transport ipv4 ! @@ -90,7 +87,6 @@ interface Ethernet9 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 - ptp role dynamic ptp sync-message interval -3 ptp transport ipv4 ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml index ad71c29fec8..8c16bc9a51e 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml @@ -274,7 +274,6 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 - role: dynamic enable: true - name: Ethernet12 peer: core-2-ospf-ldp diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/custom-ptp-profile.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/custom-ptp-profile.yml index 065808a9241..9daa77e0615 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/custom-ptp-profile.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/custom-ptp-profile.yml @@ -149,7 +149,6 @@ ethernet_interfaces: sync_message: interval: -7 transport: ipv4 - role: dynamic enable: true vlans: - id: 11 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml index 20392e6d371..71145299c22 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml @@ -216,7 +216,6 @@ ethernet_interfaces: sync_message: interval: 2 transport: ipv4 - role: dynamic enable: true - name: Ethernet7 peer: ptp-tests-spine2 @@ -235,7 +234,6 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 - role: dynamic enable: true - name: Ethernet8 peer: ptp-tests-spine2 @@ -254,7 +252,6 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 - role: dynamic enable: true - name: Ethernet9 peer: ptp-tests-spine2 @@ -273,7 +270,6 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 - role: dynamic enable: true loopback_interfaces: - name: Loopback0 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml index a35be3c0b0a..1d8ce63aca5 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml @@ -144,7 +144,6 @@ ethernet_interfaces: sync_message: interval: 2 transport: ipv4 - role: dynamic enable: true - name: Ethernet7 peer: ptp-tests-spine1 @@ -163,7 +162,6 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 - role: dynamic enable: true - name: Ethernet8 peer: ptp-tests-spine1 @@ -182,7 +180,6 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 - role: dynamic enable: true - name: Ethernet9 peer: ptp-tests-spine1 @@ -201,7 +198,6 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 - role: dynamic enable: true metadata: platform: vEOS-LAB diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md index 8861687b61c..ff4bb35b471 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md @@ -42,7 +42,7 @@ | [      bfd](## "core_interfaces.p2p_links_profiles.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "core_interfaces.p2p_links_profiles.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "core_interfaces.p2p_links_profiles.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | - | [        role](## "core_interfaces.p2p_links_profiles.[].ptp.role") | String | | `dynamic` | Valid Values:
- dynamic
- master | AVD and EOS default is `dynamic`. | + | [        role](## "core_interfaces.p2p_links_profiles.[].ptp.role") | String | | | Valid Values:
- dynamic
- master | EOS default is `dynamic`. | | [        profile](## "core_interfaces.p2p_links_profiles.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "core_interfaces.p2p_links_profiles.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "core_interfaces.p2p_links_profiles.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | @@ -92,7 +92,7 @@ | [      bfd](## "core_interfaces.p2p_links.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "core_interfaces.p2p_links.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "core_interfaces.p2p_links.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | - | [        role](## "core_interfaces.p2p_links.[].ptp.role") | String | | `dynamic` | Valid Values:
- dynamic
- master | AVD and EOS default is `dynamic`. | + | [        role](## "core_interfaces.p2p_links.[].ptp.role") | String | | | Valid Values:
- dynamic
- master | EOS default is `dynamic`. | | [        profile](## "core_interfaces.p2p_links.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "core_interfaces.p2p_links.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "core_interfaces.p2p_links.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | @@ -218,8 +218,8 @@ # Enable PTP. enabled: - # AVD and EOS default is `dynamic`. - role: + # EOS default is `dynamic`. + role: # Default available profiles are: # - "aes67" @@ -373,8 +373,8 @@ # Enable PTP. enabled: - # AVD and EOS default is `dynamic`. - role: + # EOS default is `dynamic`. + role: # Default available profiles are: # - "aes67" diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md index 9a11d0ec7f6..ae7fc79730f 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md @@ -42,7 +42,7 @@ | [      bfd](## "l3_edge.p2p_links_profiles.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "l3_edge.p2p_links_profiles.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "l3_edge.p2p_links_profiles.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | - | [        role](## "l3_edge.p2p_links_profiles.[].ptp.role") | String | | `dynamic` | Valid Values:
- dynamic
- master | AVD and EOS default is `dynamic`. | + | [        role](## "l3_edge.p2p_links_profiles.[].ptp.role") | String | | | Valid Values:
- dynamic
- master | EOS default is `dynamic`. | | [        profile](## "l3_edge.p2p_links_profiles.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "l3_edge.p2p_links_profiles.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "l3_edge.p2p_links_profiles.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | @@ -92,7 +92,7 @@ | [      bfd](## "l3_edge.p2p_links.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "l3_edge.p2p_links.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "l3_edge.p2p_links.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | - | [        role](## "l3_edge.p2p_links.[].ptp.role") | String | | `dynamic` | Valid Values:
- dynamic
- master | AVD and EOS default is `dynamic`. | + | [        role](## "l3_edge.p2p_links.[].ptp.role") | String | | | Valid Values:
- dynamic
- master | EOS default is `dynamic`. | | [        profile](## "l3_edge.p2p_links.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "l3_edge.p2p_links.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "l3_edge.p2p_links.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | @@ -218,8 +218,8 @@ # Enable PTP. enabled: - # AVD and EOS default is `dynamic`. - role: + # EOS default is `dynamic`. + role: # Default available profiles are: # - "aes67" @@ -373,8 +373,8 @@ # Enable PTP. enabled: - # AVD and EOS default is `dynamic`. - role: + # EOS default is `dynamic`. + role: # Default available profiles are: # - "aes67" diff --git a/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml b/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml index 2e03ee0f946..30a3ad66605 100644 --- a/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml @@ -9647,8 +9647,7 @@ $defs: description: Enable PTP. role: type: str - description: AVD and EOS default is `dynamic`. - default: dynamic + description: EOS default is `dynamic`. valid_values: - dynamic - master diff --git a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml index 6b04fbdd8aa..b1ea4dd7ab6 100644 --- a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml @@ -134,8 +134,7 @@ $defs: description: Enable PTP. role: type: str - description: AVD and EOS default is `dynamic`. - default: "dynamic" + description: EOS default is `dynamic`. valid_values: - "dynamic" - "master" diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py index 757a6cef3ac..3db7995ab23 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py @@ -317,8 +317,8 @@ def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link msg = f"PTP Profile '{ptp_profile_name}' referenced under {self.data_model}.p2p_links does not exist in `ptp_profiles`." ptp_config.update(get_item(self.shared_utils.ptp_profiles, "profile", ptp_profile_name, required=True, custom_error_msg=msg)) - if ptp_role := get(p2p_link, "ptp.role", default="dynamic"): - ptp_config["role"] = ptp_role + if get(p2p_link, "ptp.role") == "master": + ptp_config["role"] = "master" ptp_config["enable"] = True ptp_config.pop("profile", None) From 960abf0d8de0b739366905173a1085aca392c0c9 Mon Sep 17 00:00:00 2001 From: laxmikantchintakindi <159624484+laxmikantchintakindi@users.noreply.github.com> Date: Mon, 18 Nov 2024 12:43:30 +0530 Subject: [PATCH 15/30] Update python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/utils.py Co-authored-by: Claus Holbech --- .../_eos_designs/structured_config/connected_endpoints/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/utils.py b/python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/utils.py index f68f069f68e..8119c4f1a11 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/utils.py @@ -213,7 +213,7 @@ def _get_adapter_ptp(self: AvdStructuredConfigConnectedEndpoints, adapter: dict) ptp_config["enable"] = True - if get(adapter, "ptp.endpoint_role") != "dynamic": + if get(adapter, "ptp.endpoint_role") not in ["dynamic", "bmca"]: ptp_config["role"] = "master" ptp_config.pop("profile", None) From fccce510fff9a30457d19d3dd9f989d8e86a1feb Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Mon, 18 Nov 2024 14:56:45 +0530 Subject: [PATCH 16/30] Make role a list --- .../intended/configs/ptp-tests-spine1.cfg | 1 + .../structured_configs/ptp-tests-spine1.yml | 1 + .../inventory/group_vars/PTP_TESTS.yml | 2 +- .../docs/tables/connected-endpoints.md | 10 ++++--- .../docs/tables/core-interfaces.md | 16 +++++++----- .../roles/eos_designs/docs/tables/l3-edge.md | 16 +++++++----- .../eos_designs/docs/tables/network-ports.md | 10 ++++--- .../eos_designs/docs/tables/port-profiles.md | 10 ++++--- .../schema/eos_designs.schema.yml | 26 +++++++++++++------ .../defs_adapter_config.schema.yml | 11 +++++--- .../defs_p2p_links.schema.yml | 12 +++++---- .../core_interfaces_and_l3_edge/utils.py | 5 ++-- 12 files changed, 80 insertions(+), 40 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine1.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine1.cfg index 123c04b516b..fb7e12507c4 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/ptp-tests-spine1.cfg @@ -107,6 +107,7 @@ interface Ethernet7 ptp announce interval 0 ptp announce timeout 3 ptp delay-req interval -3 + ptp role master ptp sync-message interval -3 ptp transport ipv4 ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml index 71145299c22..c703395a611 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml @@ -234,6 +234,7 @@ ethernet_interfaces: sync_message: interval: -3 transport: ipv4 + role: master enable: true - name: Ethernet8 peer: ptp-tests-spine2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS.yml index 583211dcf0c..1d31d34b89a 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS.yml @@ -20,7 +20,7 @@ core_interfaces: interfaces: [ Ethernet7, Ethernet7 ] ptp: enabled: true - role: dynamic + role: ["master", "dynamic"] include_in_underlay_protocol: false # Testing the same as above with l3_edge diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/connected-endpoints.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/connected-endpoints.md index 5555021709a..487da91d999 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/connected-endpoints.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/connected-endpoints.md @@ -41,7 +41,7 @@ | [        qos_profile](## ".[].adapters.[].qos_profile") | String | | | | QOS profile name. | | [        ptp](## ".[].adapters.[].ptp") | Dictionary | | | | The global PTP profile parameters will be applied to all connected endpoints where `ptp` is manually enabled.
`ptp role master` is set to ensure control over the PTP topology.
| | [          enabled](## ".[].adapters.[].ptp.enabled") | Boolean | | `False` | | | - | [          endpoint_role](## ".[].adapters.[].ptp.endpoint_role") | String | | `follower` | Valid Values:
- bmca
- default
- follower
- dynamic | Set `dynamic` instead of `bmca`(deprecated). | + | [          endpoint_role](## ".[].adapters.[].ptp.endpoint_role") | String | | `follower` | Valid Values:
- follower
- dynamic
- bmca
- default | PTP role of the endpoint.
`follower` will configure the switch port as `ptp role master`.
`dynamic` will use BMCA.
`default` is deprecated in favor of `follower`.
`bmca` is deprecated in favor of `dynamic`. | | [          profile](## ".[].adapters.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [        sflow](## ".[].adapters.[].sflow") | Boolean | | | | Configures sFlow on the interface. Overrides `fabric_sflow.endpoints` setting. | | [        flow_tracking](## ".[].adapters.[].flow_tracking") | Dictionary | | | | Configures flow-tracking on the interface. Overrides `fabric_flow_tracking.endpoints` setting. | @@ -301,8 +301,12 @@ ptp: enabled: - # Set `dynamic` instead of `bmca`(deprecated). - endpoint_role: + # PTP role of the endpoint. + # `follower` will configure the switch port as `ptp role master`. + # `dynamic` will use BMCA. + # `default` is deprecated in favor of `follower`. + # `bmca` is deprecated in favor of `dynamic`. + endpoint_role: # Default available profiles are: # - "aes67" diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md index ff4bb35b471..0ce2c6fd616 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md @@ -42,7 +42,8 @@ | [      bfd](## "core_interfaces.p2p_links_profiles.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "core_interfaces.p2p_links_profiles.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "core_interfaces.p2p_links_profiles.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | - | [        role](## "core_interfaces.p2p_links_profiles.[].ptp.role") | String | | | Valid Values:
- dynamic
- master | EOS default is `dynamic`. | + | [        role](## "core_interfaces.p2p_links_profiles.[].ptp.role") | List, items: String | | | | Role in boundary clock mode. EOS default is `dynamic`. | + | [          - <str>](## "core_interfaces.p2p_links_profiles.[].ptp.role.[]") | String | | | Valid Values:
- dynamic
- master | | | [        profile](## "core_interfaces.p2p_links_profiles.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "core_interfaces.p2p_links_profiles.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "core_interfaces.p2p_links_profiles.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | @@ -92,7 +93,8 @@ | [      bfd](## "core_interfaces.p2p_links.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "core_interfaces.p2p_links.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "core_interfaces.p2p_links.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | - | [        role](## "core_interfaces.p2p_links.[].ptp.role") | String | | | Valid Values:
- dynamic
- master | EOS default is `dynamic`. | + | [        role](## "core_interfaces.p2p_links.[].ptp.role") | List, items: String | | | | Role in boundary clock mode. EOS default is `dynamic`. | + | [          - <str>](## "core_interfaces.p2p_links.[].ptp.role.[]") | String | | | Valid Values:
- dynamic
- master | | | [        profile](## "core_interfaces.p2p_links.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "core_interfaces.p2p_links.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "core_interfaces.p2p_links.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | @@ -218,8 +220,9 @@ # Enable PTP. enabled: - # EOS default is `dynamic`. - role: + # Role in boundary clock mode. EOS default is `dynamic`. + role: + - # Default available profiles are: # - "aes67" @@ -373,8 +376,9 @@ # Enable PTP. enabled: - # EOS default is `dynamic`. - role: + # Role in boundary clock mode. EOS default is `dynamic`. + role: + - # Default available profiles are: # - "aes67" diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md index ae7fc79730f..72dad25b869 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md @@ -42,7 +42,8 @@ | [      bfd](## "l3_edge.p2p_links_profiles.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "l3_edge.p2p_links_profiles.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "l3_edge.p2p_links_profiles.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | - | [        role](## "l3_edge.p2p_links_profiles.[].ptp.role") | String | | | Valid Values:
- dynamic
- master | EOS default is `dynamic`. | + | [        role](## "l3_edge.p2p_links_profiles.[].ptp.role") | List, items: String | | | | Role in boundary clock mode. EOS default is `dynamic`. | + | [          - <str>](## "l3_edge.p2p_links_profiles.[].ptp.role.[]") | String | | | Valid Values:
- dynamic
- master | | | [        profile](## "l3_edge.p2p_links_profiles.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "l3_edge.p2p_links_profiles.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "l3_edge.p2p_links_profiles.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | @@ -92,7 +93,8 @@ | [      bfd](## "l3_edge.p2p_links.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "l3_edge.p2p_links.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "l3_edge.p2p_links.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | - | [        role](## "l3_edge.p2p_links.[].ptp.role") | String | | | Valid Values:
- dynamic
- master | EOS default is `dynamic`. | + | [        role](## "l3_edge.p2p_links.[].ptp.role") | List, items: String | | | | Role in boundary clock mode. EOS default is `dynamic`. | + | [          - <str>](## "l3_edge.p2p_links.[].ptp.role.[]") | String | | | Valid Values:
- dynamic
- master | | | [        profile](## "l3_edge.p2p_links.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "l3_edge.p2p_links.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "l3_edge.p2p_links.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | @@ -218,8 +220,9 @@ # Enable PTP. enabled: - # EOS default is `dynamic`. - role: + # Role in boundary clock mode. EOS default is `dynamic`. + role: + - # Default available profiles are: # - "aes67" @@ -373,8 +376,9 @@ # Enable PTP. enabled: - # EOS default is `dynamic`. - role: + # Role in boundary clock mode. EOS default is `dynamic`. + role: + - # Default available profiles are: # - "aes67" diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/network-ports.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/network-ports.md index 4bf6f3311b1..4fbaec627be 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/network-ports.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/network-ports.md @@ -36,7 +36,7 @@ | [    qos_profile](## "network_ports.[].qos_profile") | String | | | | QOS profile name. | | [    ptp](## "network_ports.[].ptp") | Dictionary | | | | The global PTP profile parameters will be applied to all connected endpoints where `ptp` is manually enabled.
`ptp role master` is set to ensure control over the PTP topology.
| | [      enabled](## "network_ports.[].ptp.enabled") | Boolean | | `False` | | | - | [      endpoint_role](## "network_ports.[].ptp.endpoint_role") | String | | `follower` | Valid Values:
- bmca
- default
- follower
- dynamic | Set `dynamic` instead of `bmca`(deprecated). | + | [      endpoint_role](## "network_ports.[].ptp.endpoint_role") | String | | `follower` | Valid Values:
- follower
- dynamic
- bmca
- default | PTP role of the endpoint.
`follower` will configure the switch port as `ptp role master`.
`dynamic` will use BMCA.
`default` is deprecated in favor of `follower`.
`bmca` is deprecated in favor of `dynamic`. | | [      profile](## "network_ports.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [    sflow](## "network_ports.[].sflow") | Boolean | | | | Configures sFlow on the interface. Overrides `fabric_sflow.endpoints` setting. | | [    flow_tracking](## "network_ports.[].flow_tracking") | Dictionary | | | | Configures flow-tracking on the interface. Overrides `fabric_flow_tracking.endpoints` setting. | @@ -275,8 +275,12 @@ ptp: enabled: - # Set `dynamic` instead of `bmca`(deprecated). - endpoint_role: + # PTP role of the endpoint. + # `follower` will configure the switch port as `ptp role master`. + # `dynamic` will use BMCA. + # `default` is deprecated in favor of `follower`. + # `bmca` is deprecated in favor of `dynamic`. + endpoint_role: # Default available profiles are: # - "aes67" diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/port-profiles.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/port-profiles.md index 3d5a612c335..9dec90eaddd 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/port-profiles.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/port-profiles.md @@ -32,7 +32,7 @@ | [    qos_profile](## "port_profiles.[].qos_profile") | String | | | | QOS profile name. | | [    ptp](## "port_profiles.[].ptp") | Dictionary | | | | The global PTP profile parameters will be applied to all connected endpoints where `ptp` is manually enabled.
`ptp role master` is set to ensure control over the PTP topology.
| | [      enabled](## "port_profiles.[].ptp.enabled") | Boolean | | `False` | | | - | [      endpoint_role](## "port_profiles.[].ptp.endpoint_role") | String | | `follower` | Valid Values:
- bmca
- default
- follower
- dynamic | Set `dynamic` instead of `bmca`(deprecated). | + | [      endpoint_role](## "port_profiles.[].ptp.endpoint_role") | String | | `follower` | Valid Values:
- follower
- dynamic
- bmca
- default | PTP role of the endpoint.
`follower` will configure the switch port as `ptp role master`.
`dynamic` will use BMCA.
`default` is deprecated in favor of `follower`.
`bmca` is deprecated in favor of `dynamic`. | | [      profile](## "port_profiles.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [    sflow](## "port_profiles.[].sflow") | Boolean | | | | Configures sFlow on the interface. Overrides `fabric_sflow.endpoints` setting. | | [    flow_tracking](## "port_profiles.[].flow_tracking") | Dictionary | | | | Configures flow-tracking on the interface. Overrides `fabric_flow_tracking.endpoints` setting. | @@ -256,8 +256,12 @@ ptp: enabled: - # Set `dynamic` instead of `bmca`(deprecated). - endpoint_role: + # PTP role of the endpoint. + # `follower` will configure the switch port as `ptp role master`. + # `dynamic` will use BMCA. + # `default` is deprecated in favor of `follower`. + # `bmca` is deprecated in favor of `dynamic`. + endpoint_role: # Default available profiles are: # - "aes67" diff --git a/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml b/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml index 30a3ad66605..4fb3e27c55e 100644 --- a/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml @@ -5264,13 +5264,21 @@ $defs: default: false endpoint_role: type: str - description: Set `dynamic` instead of `bmca`(deprecated). + description: 'PTP role of the endpoint. + + `follower` will configure the switch port as `ptp role master`. + + `dynamic` will use BMCA. + + `default` is deprecated in favor of `follower`. + + `bmca` is deprecated in favor of `dynamic`.' default: follower valid_values: - - bmca - - default - follower - dynamic + - bmca + - default profile: type: str default: aes67-r16-2016 @@ -9646,11 +9654,13 @@ $defs: default: false description: Enable PTP. role: - type: str - description: EOS default is `dynamic`. - valid_values: - - dynamic - - master + type: list + description: Role in boundary clock mode. EOS default is `dynamic`. + items: + type: str + valid_values: + - dynamic + - master profile: type: str default: aes67-r16-2016 diff --git a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_adapter_config.schema.yml b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_adapter_config.schema.yml index 03db5d1a664..7170f11ff7e 100644 --- a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_adapter_config.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_adapter_config.schema.yml @@ -135,13 +135,18 @@ $defs: default: false endpoint_role: type: str - description: Set `dynamic` instead of `bmca`(deprecated). + description: |- + PTP role of the endpoint. + `follower` will configure the switch port as `ptp role master`. + `dynamic` will use BMCA. + `default` is deprecated in favor of `follower`. + `bmca` is deprecated in favor of `dynamic`. default: "follower" valid_values: - - "bmca" - - "default" - "follower" - "dynamic" + - "bmca" + - "default" profile: type: str default: "aes67-r16-2016" diff --git a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml index b1ea4dd7ab6..a9d3a2f9c3a 100644 --- a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml @@ -133,11 +133,13 @@ $defs: default: false description: Enable PTP. role: - type: str - description: EOS default is `dynamic`. - valid_values: - - "dynamic" - - "master" + type: list + description: Role in boundary clock mode. EOS default is `dynamic`. + items: + type: str + valid_values: + - "dynamic" + - "master" profile: type: str default: "aes67-r16-2016" diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py index 3db7995ab23..ade7e7d25e7 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py @@ -317,8 +317,9 @@ def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link msg = f"PTP Profile '{ptp_profile_name}' referenced under {self.data_model}.p2p_links does not exist in `ptp_profiles`." ptp_config.update(get_item(self.shared_utils.ptp_profiles, "profile", ptp_profile_name, required=True, custom_error_msg=msg)) - if get(p2p_link, "ptp.role") == "master": - ptp_config["role"] = "master" + node_index = p2p_link["nodes"].index(self.shared_utils.hostname) + if (ptp_role := get(p2p_link, "ptp.role")) and ptp_role[node_index] == "master": + ptp_config["role"] = "master" ptp_config["enable"] = True ptp_config.pop("profile", None) From 442d4e34132bb9bf7e4881b76056c832ca16794b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 10:03:30 +0000 Subject: [PATCH 17/30] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../structured_config/core_interfaces_and_l3_edge/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py index ade7e7d25e7..39c83763a6e 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py @@ -319,7 +319,7 @@ def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link node_index = p2p_link["nodes"].index(self.shared_utils.hostname) if (ptp_role := get(p2p_link, "ptp.role")) and ptp_role[node_index] == "master": - ptp_config["role"] = "master" + ptp_config["role"] = "master" ptp_config["enable"] = True ptp_config.pop("profile", None) From 3220ed8407ab29420b2e28e94b539b86f9a39c83 Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Tue, 19 Nov 2024 12:41:23 +0530 Subject: [PATCH 18/30] Address comments on schema and code --- .../eos_designs/docs/tables/core-interfaces.md | 16 ++++++++-------- .../avd/roles/eos_designs/docs/tables/l3-edge.md | 16 ++++++++-------- .../_eos_designs/schema/eos_designs.schema.yml | 3 ++- .../schema_fragments/defs_p2p_links.schema.yml | 3 ++- .../core_interfaces_and_l3_edge/utils.py | 4 ++-- 5 files changed, 22 insertions(+), 20 deletions(-) diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md index 0ce2c6fd616..c497b2213ea 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md @@ -42,8 +42,8 @@ | [      bfd](## "core_interfaces.p2p_links_profiles.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "core_interfaces.p2p_links_profiles.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "core_interfaces.p2p_links_profiles.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | - | [        role](## "core_interfaces.p2p_links_profiles.[].ptp.role") | List, items: String | | | | Role in boundary clock mode. EOS default is `dynamic`. | - | [          - <str>](## "core_interfaces.p2p_links_profiles.[].ptp.role.[]") | String | | | Valid Values:
- dynamic
- master | | + | [        role](## "core_interfaces.p2p_links_profiles.[].ptp.role") | List, items: String | | | | Role in boundary clock mode for each node. Default is `dynamic`. | + | [          - <str>](## "core_interfaces.p2p_links_profiles.[].ptp.role.[]") | String | | `dynamic` | Valid Values:
- dynamic
- master | | | [        profile](## "core_interfaces.p2p_links_profiles.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "core_interfaces.p2p_links_profiles.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "core_interfaces.p2p_links_profiles.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | @@ -93,8 +93,8 @@ | [      bfd](## "core_interfaces.p2p_links.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "core_interfaces.p2p_links.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "core_interfaces.p2p_links.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | - | [        role](## "core_interfaces.p2p_links.[].ptp.role") | List, items: String | | | | Role in boundary clock mode. EOS default is `dynamic`. | - | [          - <str>](## "core_interfaces.p2p_links.[].ptp.role.[]") | String | | | Valid Values:
- dynamic
- master | | + | [        role](## "core_interfaces.p2p_links.[].ptp.role") | List, items: String | | | | Role in boundary clock mode for each node. Default is `dynamic`. | + | [          - <str>](## "core_interfaces.p2p_links.[].ptp.role.[]") | String | | `dynamic` | Valid Values:
- dynamic
- master | | | [        profile](## "core_interfaces.p2p_links.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "core_interfaces.p2p_links.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "core_interfaces.p2p_links.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | @@ -220,9 +220,9 @@ # Enable PTP. enabled: - # Role in boundary clock mode. EOS default is `dynamic`. + # Role in boundary clock mode for each node. Default is `dynamic`. role: - - + - # Default available profiles are: # - "aes67" @@ -376,9 +376,9 @@ # Enable PTP. enabled: - # Role in boundary clock mode. EOS default is `dynamic`. + # Role in boundary clock mode for each node. Default is `dynamic`. role: - - + - # Default available profiles are: # - "aes67" diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md index 72dad25b869..0e90e8fe54f 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md @@ -42,8 +42,8 @@ | [      bfd](## "l3_edge.p2p_links_profiles.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "l3_edge.p2p_links_profiles.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "l3_edge.p2p_links_profiles.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | - | [        role](## "l3_edge.p2p_links_profiles.[].ptp.role") | List, items: String | | | | Role in boundary clock mode. EOS default is `dynamic`. | - | [          - <str>](## "l3_edge.p2p_links_profiles.[].ptp.role.[]") | String | | | Valid Values:
- dynamic
- master | | + | [        role](## "l3_edge.p2p_links_profiles.[].ptp.role") | List, items: String | | | | Role in boundary clock mode for each node. Default is `dynamic`. | + | [          - <str>](## "l3_edge.p2p_links_profiles.[].ptp.role.[]") | String | | `dynamic` | Valid Values:
- dynamic
- master | | | [        profile](## "l3_edge.p2p_links_profiles.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "l3_edge.p2p_links_profiles.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "l3_edge.p2p_links_profiles.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | @@ -93,8 +93,8 @@ | [      bfd](## "l3_edge.p2p_links.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "l3_edge.p2p_links.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "l3_edge.p2p_links.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | - | [        role](## "l3_edge.p2p_links.[].ptp.role") | List, items: String | | | | Role in boundary clock mode. EOS default is `dynamic`. | - | [          - <str>](## "l3_edge.p2p_links.[].ptp.role.[]") | String | | | Valid Values:
- dynamic
- master | | + | [        role](## "l3_edge.p2p_links.[].ptp.role") | List, items: String | | | | Role in boundary clock mode for each node. Default is `dynamic`. | + | [          - <str>](## "l3_edge.p2p_links.[].ptp.role.[]") | String | | `dynamic` | Valid Values:
- dynamic
- master | | | [        profile](## "l3_edge.p2p_links.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "l3_edge.p2p_links.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "l3_edge.p2p_links.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | @@ -220,9 +220,9 @@ # Enable PTP. enabled: - # Role in boundary clock mode. EOS default is `dynamic`. + # Role in boundary clock mode for each node. Default is `dynamic`. role: - - + - # Default available profiles are: # - "aes67" @@ -376,9 +376,9 @@ # Enable PTP. enabled: - # Role in boundary clock mode. EOS default is `dynamic`. + # Role in boundary clock mode for each node. Default is `dynamic`. role: - - + - # Default available profiles are: # - "aes67" diff --git a/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml b/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml index 4fb3e27c55e..1808b505f12 100644 --- a/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml @@ -9655,9 +9655,10 @@ $defs: description: Enable PTP. role: type: list - description: Role in boundary clock mode. EOS default is `dynamic`. + description: Role in boundary clock mode for each node. Default is `dynamic`. items: type: str + default: dynamic valid_values: - dynamic - master diff --git a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml index a9d3a2f9c3a..80d28317bac 100644 --- a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml @@ -134,9 +134,10 @@ $defs: description: Enable PTP. role: type: list - description: Role in boundary clock mode. EOS default is `dynamic`. + description: Role in boundary clock mode for each node. Default is `dynamic`. items: type: str + default: "dynamic" valid_values: - "dynamic" - "master" diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py index 39c83763a6e..9778fd0cfd2 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py @@ -309,11 +309,11 @@ def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link if self.shared_utils.ptp_enabled: # Apply PTP profile config from node settings when profile is not defined on p2p_link - if get(p2p_link, "ptp.profile") is None: + if (ptp_profile_name := get(p2p_link, "ptp.profile")) is None: ptp_config.update(self.shared_utils.ptp_profile) # Apply PTP profile defined for the p2p_link - if (ptp_profile_name := get(p2p_link, "ptp.profile", default=self.shared_utils.ptp_profile_name)) is not None: + else: msg = f"PTP Profile '{ptp_profile_name}' referenced under {self.data_model}.p2p_links does not exist in `ptp_profiles`." ptp_config.update(get_item(self.shared_utils.ptp_profiles, "profile", ptp_profile_name, required=True, custom_error_msg=msg)) From 82310adbf2277351258c31c3bc5812a951d0bf04 Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Tue, 19 Nov 2024 13:09:07 +0530 Subject: [PATCH 19/30] Fixing ptp role code --- .../inventory/group_vars/PTP_TESTS.yml | 2 +- .../roles/eos_designs/docs/tables/core-interfaces.md | 12 ++++++------ .../avd/roles/eos_designs/docs/tables/l3-edge.md | 12 ++++++------ .../pyavd/_eos_designs/schema/eos_designs.schema.yml | 2 +- .../schema_fragments/defs_p2p_links.schema.yml | 2 +- .../core_interfaces_and_l3_edge/utils.py | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS.yml index 1d31d34b89a..2ef8cec0535 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/PTP_TESTS.yml @@ -20,7 +20,7 @@ core_interfaces: interfaces: [ Ethernet7, Ethernet7 ] ptp: enabled: true - role: ["master", "dynamic"] + roles: ["master", "dynamic"] include_in_underlay_protocol: false # Testing the same as above with l3_edge diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md index c497b2213ea..8eae83c0fe1 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/core-interfaces.md @@ -42,8 +42,8 @@ | [      bfd](## "core_interfaces.p2p_links_profiles.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "core_interfaces.p2p_links_profiles.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "core_interfaces.p2p_links_profiles.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | - | [        role](## "core_interfaces.p2p_links_profiles.[].ptp.role") | List, items: String | | | | Role in boundary clock mode for each node. Default is `dynamic`. | - | [          - <str>](## "core_interfaces.p2p_links_profiles.[].ptp.role.[]") | String | | `dynamic` | Valid Values:
- dynamic
- master | | + | [        roles](## "core_interfaces.p2p_links_profiles.[].ptp.roles") | List, items: String | | | | Role in boundary clock mode for each node. Default is `dynamic`. | + | [          - <str>](## "core_interfaces.p2p_links_profiles.[].ptp.roles.[]") | String | | `dynamic` | Valid Values:
- dynamic
- master | | | [        profile](## "core_interfaces.p2p_links_profiles.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "core_interfaces.p2p_links_profiles.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "core_interfaces.p2p_links_profiles.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | @@ -93,8 +93,8 @@ | [      bfd](## "core_interfaces.p2p_links.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "core_interfaces.p2p_links.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "core_interfaces.p2p_links.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | - | [        role](## "core_interfaces.p2p_links.[].ptp.role") | List, items: String | | | | Role in boundary clock mode for each node. Default is `dynamic`. | - | [          - <str>](## "core_interfaces.p2p_links.[].ptp.role.[]") | String | | `dynamic` | Valid Values:
- dynamic
- master | | + | [        roles](## "core_interfaces.p2p_links.[].ptp.roles") | List, items: String | | | | Role in boundary clock mode for each node. Default is `dynamic`. | + | [          - <str>](## "core_interfaces.p2p_links.[].ptp.roles.[]") | String | | `dynamic` | Valid Values:
- dynamic
- master | | | [        profile](## "core_interfaces.p2p_links.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "core_interfaces.p2p_links.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "core_interfaces.p2p_links.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | @@ -221,7 +221,7 @@ enabled: # Role in boundary clock mode for each node. Default is `dynamic`. - role: + roles: - # Default available profiles are: @@ -377,7 +377,7 @@ enabled: # Role in boundary clock mode for each node. Default is `dynamic`. - role: + roles: - # Default available profiles are: diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md index 0e90e8fe54f..e51b6e0a0d5 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/l3-edge.md @@ -42,8 +42,8 @@ | [      bfd](## "l3_edge.p2p_links_profiles.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "l3_edge.p2p_links_profiles.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "l3_edge.p2p_links_profiles.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | - | [        role](## "l3_edge.p2p_links_profiles.[].ptp.role") | List, items: String | | | | Role in boundary clock mode for each node. Default is `dynamic`. | - | [          - <str>](## "l3_edge.p2p_links_profiles.[].ptp.role.[]") | String | | `dynamic` | Valid Values:
- dynamic
- master | | + | [        roles](## "l3_edge.p2p_links_profiles.[].ptp.roles") | List, items: String | | | | Role in boundary clock mode for each node. Default is `dynamic`. | + | [          - <str>](## "l3_edge.p2p_links_profiles.[].ptp.roles.[]") | String | | `dynamic` | Valid Values:
- dynamic
- master | | | [        profile](## "l3_edge.p2p_links_profiles.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "l3_edge.p2p_links_profiles.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "l3_edge.p2p_links_profiles.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | @@ -93,8 +93,8 @@ | [      bfd](## "l3_edge.p2p_links.[].bfd") | Boolean | | | | Enable BFD (only considered for BGP). | | [      ptp](## "l3_edge.p2p_links.[].ptp") | Dictionary | | | | PTP parameters. | | [        enabled](## "l3_edge.p2p_links.[].ptp.enabled") | Boolean | | `False` | | Enable PTP. | - | [        role](## "l3_edge.p2p_links.[].ptp.role") | List, items: String | | | | Role in boundary clock mode for each node. Default is `dynamic`. | - | [          - <str>](## "l3_edge.p2p_links.[].ptp.role.[]") | String | | `dynamic` | Valid Values:
- dynamic
- master | | + | [        roles](## "l3_edge.p2p_links.[].ptp.roles") | List, items: String | | | | Role in boundary clock mode for each node. Default is `dynamic`. | + | [          - <str>](## "l3_edge.p2p_links.[].ptp.roles.[]") | String | | `dynamic` | Valid Values:
- dynamic
- master | | | [        profile](## "l3_edge.p2p_links.[].ptp.profile") | String | | `aes67-r16-2016` | | Default available profiles are:
- "aes67"
- "aes67-r16-2016"
- "smpte2059-2" | | [      sflow](## "l3_edge.p2p_links.[].sflow") | Boolean | | | | Enable sFlow. Overrides `fabric_sflow` setting. | | [      underlay_multicast](## "l3_edge.p2p_links.[].underlay_multicast") | Boolean | | `False` | | Enable PIM sparse mode. Requires `include_in_underlay_protocol` and the global `underlay_multicast` to be `true`. | @@ -221,7 +221,7 @@ enabled: # Role in boundary clock mode for each node. Default is `dynamic`. - role: + roles: - # Default available profiles are: @@ -377,7 +377,7 @@ enabled: # Role in boundary clock mode for each node. Default is `dynamic`. - role: + roles: - # Default available profiles are: diff --git a/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml b/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml index 1808b505f12..0a5f1f22f37 100644 --- a/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml @@ -9653,7 +9653,7 @@ $defs: type: bool default: false description: Enable PTP. - role: + roles: type: list description: Role in boundary clock mode for each node. Default is `dynamic`. items: diff --git a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml index 80d28317bac..3c8ac353655 100644 --- a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml @@ -132,7 +132,7 @@ $defs: type: bool default: false description: Enable PTP. - role: + roles: type: list description: Role in boundary clock mode for each node. Default is `dynamic`. items: diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py index 9778fd0cfd2..22e6950df55 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py @@ -318,7 +318,7 @@ def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link ptp_config.update(get_item(self.shared_utils.ptp_profiles, "profile", ptp_profile_name, required=True, custom_error_msg=msg)) node_index = p2p_link["nodes"].index(self.shared_utils.hostname) - if (ptp_role := get(p2p_link, "ptp.role")) and ptp_role[node_index] == "master": + if (ptp_roles := get(p2p_link, "ptp.roles")) and len(ptp_roles) > node_index and ptp_roles[node_index] == "master": ptp_config["role"] = "master" ptp_config["enable"] = True From 397a12a7b7e1c078c8dc515be67490dc3e655008 Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Thu, 21 Nov 2024 15:03:46 +0530 Subject: [PATCH 20/30] Fixing port-channel configuration for ptp --- .../intended/configs/core-1-isis-sr-ldp.cfg | 6 +++ .../intended/configs/core-2-ospf-ldp.cfg | 24 +++++++++ .../structured_configs/core-1-isis-sr-ldp.yml | 9 ++++ .../structured_configs/core-2-ospf-ldp.yml | 34 ++++++++++++ .../inventory/group_vars/CORE_UNIT_TESTS.yml | 6 +++ .../host_vars/core-1-isis-sr-ldp.yml | 2 - .../port_channel_interfaces.py | 3 ++ .../core_interfaces_and_l3_edge/utils.py | 52 +++++++++++-------- 8 files changed, 112 insertions(+), 24 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-1-isis-sr-ldp.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-1-isis-sr-ldp.cfg index 9a28b2e22d1..39dcef7a308 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-1-isis-sr-ldp.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-1-isis-sr-ldp.cfg @@ -80,6 +80,12 @@ interface Port-Channel16 mpls ldp igp sync mpls ldp interface mpls ip + ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 isis enable CORE isis circuit-type level-2 isis metric 60 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-2-ospf-ldp.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-2-ospf-ldp.cfg index b948c8f4b20..4c29a9304c4 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-2-ospf-ldp.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/core-2-ospf-ldp.cfg @@ -10,6 +10,19 @@ service routing protocols model multi-agent ! hostname core-2-ospf-ldp ! +ptp clock-identity 00:1C:73:7f:00:02 +ptp domain 127 +ptp mode boundary +ptp priority1 127 +ptp priority2 2 +ptp monitor threshold offset-from-master 250 +ptp monitor threshold mean-path-delay 1500 +ptp monitor sequence-id +ptp monitor threshold missing-message sync 3 sequence-ids +ptp monitor threshold missing-message follow-up 3 sequence-ids +ptp monitor threshold missing-message delay-resp 3 sequence-ids +ptp monitor threshold missing-message announce 3 sequence-ids +! spanning-tree mode none ! vrf instance MGMT @@ -59,6 +72,12 @@ interface Port-Channel16 mpls ip ip ospf network point-to-point ip ospf area 0.0.0.0 + ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ! interface Ethernet1 description P2P_LINK_TO_CORE-1-ISIS-SR-LDP_Ethernet1 @@ -153,6 +172,11 @@ interface Ethernet10 ip ospf network point-to-point ip ospf area 0.0.0.0 ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ! interface Ethernet12 description P2P_LINK_TO_CORE-1-ISIS-SR-LDP_Ethernet12 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml index 8c16bc9a51e..956e5af49a8 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml @@ -477,3 +477,12 @@ port_channel_interfaces: interface: true igp_sync: true description: CUSTOM_DESCRIPTION_ON_P2P_LINK_A + ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 + enable: true diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-2-ospf-ldp.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-2-ospf-ldp.yml index 29c2446b949..b75702910d4 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-2-ospf-ldp.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-2-ospf-ldp.yml @@ -27,6 +27,24 @@ management_api_http: enable_vrfs: - name: MGMT enable_https: true +ptp: + mode: boundary + clock_identity: 00:1C:73:7f:00:02 + priority1: 127 + priority2: 2 + domain: 127 + monitor: + enabled: true + threshold: + offset_from_master: 250 + mean_path_delay: 1500 + missing_message: + sequence_ids: + enabled: true + announce: 3 + delay_resp: 3 + follow_up: 3 + sync: 3 router_general: router_id: ipv4: 10.0.0.2 @@ -191,6 +209,13 @@ ethernet_interfaces: description: P2P_LINK_TO_CORE-1-ISIS-SR-LDP_Ethernet10 speed: forced 1000full ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 enable: true - name: Ethernet12 peer: core-1-isis-sr-ldp @@ -307,3 +332,12 @@ port_channel_interfaces: interface: true igp_sync: true description: CUSTOM_DESCRIPTION_ON_P2P_LINK_B + ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 + enable: true diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/CORE_UNIT_TESTS.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/CORE_UNIT_TESTS.yml index 2fad75887f8..8cedb9d2341 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/CORE_UNIT_TESTS.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/CORE_UNIT_TESTS.yml @@ -47,8 +47,12 @@ core_router: nodes: - name: core-1-isis-sr-ldp id: 1 + ptp: + enabled: true - name: core-2-ospf-ldp id: 2 + ptp: + enabled: true - name: core-3-isis-sr-ldp id: 3 - name: core-4-multicast @@ -180,6 +184,8 @@ core_interfaces: - node: core-2-ospf-ldp interfaces: [ Ethernet16, Ethernet17 ] profile: isis_bb_profile + ptp: + enabled: true # P2P core links with underlay_multicast(pim-sparse) enabled. - nodes: [ core-4-multicast, peer1 ] diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/core-1-isis-sr-ldp.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/core-1-isis-sr-ldp.yml index e4f7682d2c3..aeb92fa75ba 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/core-1-isis-sr-ldp.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/core-1-isis-sr-ldp.yml @@ -2,5 +2,3 @@ underlay_routing_protocol: isis-sr-ldp # Use router id from router general configuration use_router_general_for_router_id: true -ptp_settings: - enabled: true diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/port_channel_interfaces.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/port_channel_interfaces.py index b69ca8a2f7e..8ea1aa01bbf 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/port_channel_interfaces.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/port_channel_interfaces.py @@ -36,6 +36,9 @@ def port_channel_interfaces(self: AvdStructuredConfigCoreInterfacesAndL3Edge) -> # Remove None values port_channel_interface = {key: value for key, value in port_channel_interface.items() if value is not None} + + if get(p2p_link, "ptp.enabled") and (ptp_config := self._get_interface_ptp_config(p2p_link)) is not None: + port_channel_interface["ptp"] = ptp_config port_channel_interfaces.append(port_channel_interface) diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py index 22e6950df55..f8a856ee280 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py @@ -302,28 +302,9 @@ def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link """ ethernet_cfg = {"speed": p2p_link.get("speed")} - if get(p2p_link, "ptp.enabled") is not True: - return ethernet_cfg - - ptp_config = {} - - if self.shared_utils.ptp_enabled: - # Apply PTP profile config from node settings when profile is not defined on p2p_link - if (ptp_profile_name := get(p2p_link, "ptp.profile")) is None: - ptp_config.update(self.shared_utils.ptp_profile) - - # Apply PTP profile defined for the p2p_link - else: - msg = f"PTP Profile '{ptp_profile_name}' referenced under {self.data_model}.p2p_links does not exist in `ptp_profiles`." - ptp_config.update(get_item(self.shared_utils.ptp_profiles, "profile", ptp_profile_name, required=True, custom_error_msg=msg)) - - node_index = p2p_link["nodes"].index(self.shared_utils.hostname) - if (ptp_roles := get(p2p_link, "ptp.roles")) and len(ptp_roles) > node_index and ptp_roles[node_index] == "master": - ptp_config["role"] = "master" - - ptp_config["enable"] = True - ptp_config.pop("profile", None) - ethernet_cfg["ptp"] = ptp_config + if get(p2p_link, "port_channel") is None and get(p2p_link, "ptp.enabled") is True: + if ptp_config := self._get_interface_ptp_config(p2p_link): + ethernet_cfg["ptp"] = ptp_config return ethernet_cfg @@ -344,3 +325,30 @@ def _get_port_channel_member_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edg "mode": get(p2p_link, "port_channel.mode", default="active"), }, } + + def _get_interface_ptp_config(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link: dict) -> dict: + """ + Return partial structured_config for one p2p_link. + + Covers PTP config for ethernet and port channel interfaces + """ + ptp_config = {} + + if self.shared_utils.ptp_enabled and get(p2p_link, "ptp.enabled"): + # Apply PTP profile config from node settings when profile is not defined on p2p_link + if (ptp_profile_name := get(p2p_link, "ptp.profile")) is None: + ptp_config.update(self.shared_utils.ptp_profile) + + # Apply PTP profile defined for the p2p_link + else: + msg = f"PTP Profile '{ptp_profile_name}' referenced under {self.data_model}.p2p_links does not exist in `ptp_profiles`." + ptp_config.update(get_item(self.shared_utils.ptp_profiles, "profile", ptp_profile_name, required=True, custom_error_msg=msg)) + + node_index = p2p_link["nodes"].index(self.shared_utils.hostname) + if (ptp_roles := get(p2p_link, "ptp.roles")) and len(ptp_roles) > node_index and ptp_roles[node_index] == "master": + ptp_config["role"] = "master" + + ptp_config["enable"] = True + ptp_config.pop("profile", None) + + return ptp_config From c47744a6bdc7a7770f9d174bcdfba0cf69f4f80a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 11:18:46 +0000 Subject: [PATCH 21/30] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../core_interfaces_and_l3_edge/port_channel_interfaces.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/port_channel_interfaces.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/port_channel_interfaces.py index 8ea1aa01bbf..2d243936d8f 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/port_channel_interfaces.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/port_channel_interfaces.py @@ -36,7 +36,7 @@ def port_channel_interfaces(self: AvdStructuredConfigCoreInterfacesAndL3Edge) -> # Remove None values port_channel_interface = {key: value for key, value in port_channel_interface.items() if value is not None} - + if get(p2p_link, "ptp.enabled") and (ptp_config := self._get_interface_ptp_config(p2p_link)) is not None: port_channel_interface["ptp"] = ptp_config From f0298010ab88cbace9a725d7d9ecf26d159c2d26 Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Thu, 21 Nov 2024 16:59:48 +0530 Subject: [PATCH 22/30] Fix CI --- .../core_interfaces_and_l3_edge/utils.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py index f8a856ee280..ade6a46e5c1 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py @@ -302,9 +302,11 @@ def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link """ ethernet_cfg = {"speed": p2p_link.get("speed")} - if get(p2p_link, "port_channel") is None and get(p2p_link, "ptp.enabled") is True: - if ptp_config := self._get_interface_ptp_config(p2p_link): - ethernet_cfg["ptp"] = ptp_config + if get(p2p_link, "port_channel") is not None: + return ethernet_cfg + + if get(p2p_link, "ptp.enabled") is True and (ptp_config := self._get_interface_ptp_config(p2p_link)): + ethernet_cfg["ptp"] = ptp_config return ethernet_cfg From a0c1cc18231b60d7f141922b14567a2d781028e0 Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Fri, 22 Nov 2024 11:59:46 +0530 Subject: [PATCH 23/30] Final update --- .../documentation/devices/DC1-POD1-LEAF2B.md | 5 ++ .../documentation/devices/DC1-POD2-SPINE2.md | 5 ++ .../documentation/devices/DC1-SUPER-SPINE1.md | 5 ++ .../documentation/devices/DC2-POD1-LEAF1A.md | 5 ++ .../documentation/devices/DC2-POD1-SPINE2.md | 5 ++ .../documentation/devices/DC2-SUPER-SPINE1.md | 5 ++ .../intended/configs/DC1-POD1-LEAF2B.cfg | 5 ++ .../intended/configs/DC1-POD2-SPINE2.cfg | 5 ++ .../intended/configs/DC1-SUPER-SPINE1.cfg | 5 ++ .../intended/configs/DC2-POD1-LEAF1A.cfg | 5 ++ .../intended/configs/DC2-POD1-SPINE2.cfg | 5 ++ .../intended/configs/DC2-SUPER-SPINE1.cfg | 5 ++ .../structured_configs/DC1-POD1-LEAF2B.yml | 9 +++- .../structured_configs/DC1-POD2-SPINE2.yml | 9 +++- .../structured_configs/DC1-SUPER-SPINE1.yml | 11 +++- .../structured_configs/DC2-POD1-LEAF1A.yml | 9 +++- .../structured_configs/DC2-POD1-SPINE2.yml | 9 +++- .../structured_configs/DC2-SUPER-SPINE1.yml | 11 +++- .../intended/configs/l3_edge_bgp.cfg | 18 +++++++ .../intended/configs/l3_edge_isis.cfg | 18 +++++++ .../intended/configs/l3_edge_ospf.cfg | 18 +++++++ .../structured_configs/core-1-isis-sr-ldp.yml | 36 ++++++------- .../structured_configs/core-2-ospf-ldp.yml | 36 ++++++------- .../structured_configs/custom-ptp-profile.yml | 2 +- .../structured_configs/l3_edge_bgp.yml | 29 +++++++++- .../structured_configs/l3_edge_isis.yml | 29 +++++++++- .../structured_configs/l3_edge_ospf.yml | 29 +++++++++- .../structured_configs/ptp-tests-spine1.yml | 8 +-- .../structured_configs/ptp-tests-spine2.yml | 8 +-- .../inventory/host_vars/l3_edge_bgp.yml | 2 + .../inventory/host_vars/l3_edge_isis.yml | 2 + .../inventory/host_vars/l3_edge_ospf.yml | 2 + .../port_channel_interfaces.py | 3 -- .../core_interfaces_and_l3_edge/utils.py | 53 +++++++------------ 34 files changed, 316 insertions(+), 95 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md index 51901414dc5..da852c81ba7 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md @@ -359,6 +359,11 @@ interface Ethernet7 no switchport ip address 11.1.0.38/31 ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ! interface Ethernet11 description P2P_DC1-POD1-SPINE1_Ethernet8 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md index 0bcb11606b7..d45b29beb76 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md @@ -215,6 +215,11 @@ interface Ethernet4 no switchport ip address 200.200.200.101/24 ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ``` ### Loopback Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md index 6888c94e063..7383876048b 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md @@ -204,6 +204,11 @@ interface Ethernet6 ip address 11.1.2.0/31 mac security profile MACSEC_PROFILE ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ``` ### Loopback Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md index 1e0264a2bef..e37247d5ca3 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md @@ -263,6 +263,11 @@ interface Ethernet7 no switchport ip address 11.1.0.39/31 ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ``` ### Port-Channel Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md index 210db623f3d..95b9a4dfeae 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md @@ -219,6 +219,11 @@ interface Ethernet5 no switchport ip address 200.200.200.201/24 ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ``` ### Loopback Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md index d9f4c11a72b..542107ae774 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md @@ -215,6 +215,11 @@ interface Ethernet4 ip address 11.1.2.1/31 mac security profile MACSEC_PROFILE ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ! interface Ethernet5 description P2P_DC2-RS2_Ethernet1 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg index b3dd44286bf..ad0d02ff69d 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg @@ -178,6 +178,11 @@ interface Ethernet7 no switchport ip address 11.1.0.38/31 ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ! interface Ethernet11 description P2P_DC1-POD1-SPINE1_Ethernet8 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg index dd68564c565..b7d5e2d8066 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg @@ -58,6 +58,11 @@ interface Ethernet4 no switchport ip address 200.200.200.101/24 ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg index 4a33013d7db..149b7cb4328 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg @@ -75,6 +75,11 @@ interface Ethernet6 ip address 11.1.2.0/31 mac security profile MACSEC_PROFILE ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg index e2defc66107..e0a095ce697 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg @@ -79,6 +79,11 @@ interface Ethernet7 no switchport ip address 11.1.0.39/31 ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg index 57de23b9a86..cf3b05e5722 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg @@ -63,6 +63,11 @@ interface Ethernet5 no switchport ip address 200.200.200.201/24 ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg index 56072e92586..4e778bcf4c8 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg @@ -55,6 +55,11 @@ interface Ethernet4 ip address 11.1.2.1/31 mac security profile MACSEC_PROFILE ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 ! interface Ethernet5 description P2P_DC2-RS2_Ethernet1 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml index f26c99dc6ab..aed209b1837 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml @@ -656,9 +656,16 @@ ethernet_interfaces: enabled: false shutdown: false ip_address: 11.1.0.38/31 - description: P2P_DC2-POD1-LEAF1A_Ethernet7 ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 enable: true + description: P2P_DC2-POD1-LEAF1A_Ethernet7 - name: Ethernet16 peer: server-1 peer_interface: Eth2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml index 45ed1842ff8..9c8d9db31b8 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml @@ -170,9 +170,16 @@ ethernet_interfaces: enabled: false shutdown: false ip_address: 200.200.200.101/24 - description: P2P_DC2-POD1-SPINE2_Ethernet5 ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 enable: true + description: P2P_DC2-POD1-SPINE2_Ethernet5 loopback_interfaces: - name: Loopback0 description: ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml index 159327fc021..d36b7ed23a2 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml @@ -170,11 +170,18 @@ ethernet_interfaces: enabled: false shutdown: false ip_address: 11.1.2.0/31 + ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 + enable: true mac_security: profile: MACSEC_PROFILE description: P2P_DC2-SUPER-SPINE1_Ethernet4 - ptp: - enable: true loopback_interfaces: - name: Loopback0 description: ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml index 48c8d5077ea..fbb46856e09 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml @@ -272,9 +272,16 @@ ethernet_interfaces: enabled: false shutdown: false ip_address: 11.1.0.39/31 - description: P2P_DC1-POD1-LEAF2B_Ethernet7 ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 enable: true + description: P2P_DC1-POD1-LEAF2B_Ethernet7 port_channel_interfaces: - name: Port-Channel3 description: L2_DC2-POD1-L2LEAF1A_Port-Channel1 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml index c0b79d60b56..3f22c2ffde6 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml @@ -154,9 +154,16 @@ ethernet_interfaces: enabled: false shutdown: false ip_address: 200.200.200.201/24 - description: P2P_DC1-POD2-SPINE2_Ethernet4 ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 enable: true + description: P2P_DC1-POD2-SPINE2_Ethernet4 loopback_interfaces: - name: Loopback0 description: ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml index 8a249940d24..3ed3f782c36 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml @@ -219,11 +219,18 @@ ethernet_interfaces: enabled: false shutdown: false ip_address: 11.1.2.1/31 + ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 + enable: true mac_security: profile: MACSEC_PROFILE description: P2P_DC1-SUPER-SPINE1_Ethernet6 - ptp: - enable: true loopback_interfaces: - name: Loopback0 description: ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_bgp.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_bgp.cfg index 4cfaba9b585..ab2a855e46d 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_bgp.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_bgp.cfg @@ -10,6 +10,19 @@ service routing protocols model multi-agent ! hostname l3_edge_bgp ! +ptp clock-identity 00:1C:73:14:00:01 +ptp domain 127 +ptp mode boundary +ptp priority1 20 +ptp priority2 1 +ptp monitor threshold offset-from-master 250 +ptp monitor threshold mean-path-delay 1500 +ptp monitor sequence-id +ptp monitor threshold missing-message sync 3 sequence-ids +ptp monitor threshold missing-message follow-up 3 sequence-ids +ptp monitor threshold missing-message delay-resp 3 sequence-ids +ptp monitor threshold missing-message announce 3 sequence-ids +! spanning-tree mode none ! vrf instance MGMT @@ -44,6 +57,11 @@ interface ethernet1 ip address 192.168.0.0/31 mac security profile TEST-MACSEC-PROFILE ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 service-policy type qos input TEST_POLICY service-profile TEST-QOS-PROFILE ! TEST RAW_EOS_CLI diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_isis.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_isis.cfg index c1ff76a9de2..4920f2721dd 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_isis.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_isis.cfg @@ -10,6 +10,19 @@ service routing protocols model multi-agent ! hostname l3_edge_isis ! +ptp clock-identity 00:1C:73:14:00:01 +ptp domain 127 +ptp mode boundary +ptp priority1 20 +ptp priority2 1 +ptp monitor threshold offset-from-master 250 +ptp monitor threshold mean-path-delay 1500 +ptp monitor sequence-id +ptp monitor threshold missing-message sync 3 sequence-ids +ptp monitor threshold missing-message follow-up 3 sequence-ids +ptp monitor threshold missing-message delay-resp 3 sequence-ids +ptp monitor threshold missing-message announce 3 sequence-ids +! spanning-tree mode none ! vrf instance MGMT @@ -30,6 +43,11 @@ interface ethernet1 ip address 192.168.0.0/31 mac security profile TEST-MACSEC-PROFILE ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 service-profile TEST-QOS-PROFILE ! interface ethernet2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_ospf.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_ospf.cfg index 762df9dc35f..b654bece544 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_ospf.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/l3_edge_ospf.cfg @@ -10,6 +10,19 @@ service routing protocols model multi-agent ! hostname l3_edge_ospf ! +ptp clock-identity 00:1C:73:14:00:01 +ptp domain 127 +ptp mode boundary +ptp priority1 20 +ptp priority2 1 +ptp monitor threshold offset-from-master 250 +ptp monitor threshold mean-path-delay 1500 +ptp monitor sequence-id +ptp monitor threshold missing-message sync 3 sequence-ids +ptp monitor threshold missing-message follow-up 3 sequence-ids +ptp monitor threshold missing-message delay-resp 3 sequence-ids +ptp monitor threshold missing-message announce 3 sequence-ids +! spanning-tree mode none ! vrf instance MGMT @@ -30,6 +43,11 @@ interface ethernet1 ip address 192.168.0.0/31 mac security profile TEST-MACSEC-PROFILE ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 service-profile TEST-QOS-PROFILE ! interface ethernet2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml index 956e5af49a8..4fc590d464b 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-1-isis-sr-ldp.yml @@ -254,6 +254,15 @@ ethernet_interfaces: shutdown: false mtu: 1500 ip_address: 100.64.48.12/31 + ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 + enable: true isis_enable: CORE isis_metric: 50 isis_network_point_to_point: true @@ -266,15 +275,6 @@ ethernet_interfaces: igp_sync: true description: P2P_LINK_TO_CORE-2-OSPF-LDP_Ethernet10 speed: forced 1000full - ptp: - announce: - interval: 0 - timeout: 3 - delay_req: -3 - sync_message: - interval: -3 - transport: ipv4 - enable: true - name: Ethernet12 peer: core-2-ospf-ldp peer_interface: Ethernet12 @@ -460,6 +460,15 @@ port_channel_interfaces: shutdown: false mtu: 1500 ip_address: 100.64.48.16/31 + ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 + enable: true ipv6_enable: true isis_enable: CORE isis_metric: 60 @@ -477,12 +486,3 @@ port_channel_interfaces: interface: true igp_sync: true description: CUSTOM_DESCRIPTION_ON_P2P_LINK_A - ptp: - announce: - interval: 0 - timeout: 3 - delay_req: -3 - sync_message: - interval: -3 - transport: ipv4 - enable: true diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-2-ospf-ldp.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-2-ospf-ldp.yml index b75702910d4..ec34d84e8e7 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-2-ospf-ldp.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/core-2-ospf-ldp.yml @@ -199,15 +199,6 @@ ethernet_interfaces: shutdown: false mtu: 1500 ip_address: 100.64.48.13/31 - ospf_network_point_to_point: true - ospf_area: 0.0.0.0 - mpls: - ip: true - ldp: - interface: true - igp_sync: true - description: P2P_LINK_TO_CORE-1-ISIS-SR-LDP_Ethernet10 - speed: forced 1000full ptp: announce: interval: 0 @@ -217,6 +208,15 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + ospf_network_point_to_point: true + ospf_area: 0.0.0.0 + mpls: + ip: true + ldp: + interface: true + igp_sync: true + description: P2P_LINK_TO_CORE-1-ISIS-SR-LDP_Ethernet10 + speed: forced 1000full - name: Ethernet12 peer: core-1-isis-sr-ldp peer_interface: Ethernet12 @@ -323,15 +323,6 @@ port_channel_interfaces: shutdown: false mtu: 1500 ip_address: 100.64.48.17/31 - ipv6_enable: true - ospf_network_point_to_point: true - ospf_area: 0.0.0.0 - mpls: - ip: true - ldp: - interface: true - igp_sync: true - description: CUSTOM_DESCRIPTION_ON_P2P_LINK_B ptp: announce: interval: 0 @@ -341,3 +332,12 @@ port_channel_interfaces: interval: -3 transport: ipv4 enable: true + ipv6_enable: true + ospf_network_point_to_point: true + ospf_area: 0.0.0.0 + mpls: + ip: true + ldp: + interface: true + igp_sync: true + description: CUSTOM_DESCRIPTION_ON_P2P_LINK_B diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/custom-ptp-profile.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/custom-ptp-profile.yml index 9daa77e0615..f441ed5e67e 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/custom-ptp-profile.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/custom-ptp-profile.yml @@ -140,7 +140,6 @@ ethernet_interfaces: enabled: false shutdown: false mtu: 9214 - description: P2P_not-in-this-fabric_Ethernet8 ptp: announce: interval: 4 @@ -150,6 +149,7 @@ ethernet_interfaces: interval: -7 transport: ipv4 enable: true + description: P2P_not-in-this-fabric_Ethernet8 vlans: - id: 11 name: VLAN11 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_bgp.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_bgp.yml index c3ceb717a5f..cd4fb857328 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_bgp.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_bgp.yml @@ -72,6 +72,24 @@ management_api_http: enable_vrfs: - name: MGMT enable_https: true +ptp: + mode: boundary + clock_identity: 00:1C:73:14:00:01 + priority1: 20 + priority2: 1 + domain: 127 + monitor: + enabled: true + threshold: + offset_from_master: 250 + mean_path_delay: 1500 + missing_message: + sequence_ids: + enabled: true + announce: 3 + delay_resp: 3 + follow_up: 3 + sync: 3 loopback_interfaces: - name: Loopback0 description: ROUTER_ID @@ -103,12 +121,19 @@ ethernet_interfaces: ' ip_address: 192.168.0.0/31 + ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 + enable: true mac_security: profile: TEST-MACSEC-PROFILE description: P2P_peer1_ethernet1 speed: forced 10000full - ptp: - enable: true service_policy: qos: input: TEST_POLICY diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_isis.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_isis.yml index 207a4a9a407..a659f6cfe9f 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_isis.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_isis.yml @@ -22,6 +22,24 @@ management_api_http: enable_vrfs: - name: MGMT enable_https: true +ptp: + mode: boundary + clock_identity: 00:1C:73:14:00:01 + priority1: 20 + priority2: 1 + domain: 127 + monitor: + enabled: true + threshold: + offset_from_master: 250 + mean_path_delay: 1500 + missing_message: + sequence_ids: + enabled: true + announce: 3 + delay_resp: 3 + follow_up: 3 + sync: 3 loopback_interfaces: - name: Loopback0 description: ROUTER_ID @@ -49,12 +67,19 @@ ethernet_interfaces: mtu: 2000 service_profile: TEST-QOS-PROFILE ip_address: 192.168.0.0/31 + ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 + enable: true mac_security: profile: TEST-MACSEC-PROFILE description: P2P_peer1_ethernet1 speed: forced 10000full - ptp: - enable: true - name: ethernet2 peer: peer2 peer_interface: ethernet2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_ospf.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_ospf.yml index 703e8a7d313..d7d84e4d162 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_ospf.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/l3_edge_ospf.yml @@ -22,6 +22,24 @@ management_api_http: enable_vrfs: - name: MGMT enable_https: true +ptp: + mode: boundary + clock_identity: 00:1C:73:14:00:01 + priority1: 20 + priority2: 1 + domain: 127 + monitor: + enabled: true + threshold: + offset_from_master: 250 + mean_path_delay: 1500 + missing_message: + sequence_ids: + enabled: true + announce: 3 + delay_resp: 3 + follow_up: 3 + sync: 3 loopback_interfaces: - name: Loopback0 description: ROUTER_ID @@ -50,12 +68,19 @@ ethernet_interfaces: mtu: 2000 service_profile: TEST-QOS-PROFILE ip_address: 192.168.0.0/31 + ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 + enable: true mac_security: profile: TEST-MACSEC-PROFILE description: P2P_peer1_ethernet1 speed: forced 10000full - ptp: - enable: true - name: ethernet2 peer: peer2 peer_interface: ethernet2 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml index c703395a611..651c29025ba 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine1.yml @@ -207,7 +207,6 @@ ethernet_interfaces: enabled: false shutdown: false mtu: 9214 - description: P2P_ptp-tests-spine2_Ethernet6 ptp: announce: interval: 2 @@ -217,6 +216,7 @@ ethernet_interfaces: interval: 2 transport: ipv4 enable: true + description: P2P_ptp-tests-spine2_Ethernet6 - name: Ethernet7 peer: ptp-tests-spine2 peer_interface: Ethernet7 @@ -225,7 +225,6 @@ ethernet_interfaces: enabled: false shutdown: false mtu: 9214 - description: P2P_ptp-tests-spine2_Ethernet7 ptp: announce: interval: 0 @@ -236,6 +235,7 @@ ethernet_interfaces: transport: ipv4 role: master enable: true + description: P2P_ptp-tests-spine2_Ethernet7 - name: Ethernet8 peer: ptp-tests-spine2 peer_interface: Ethernet8 @@ -244,7 +244,6 @@ ethernet_interfaces: enabled: false shutdown: false mtu: 9214 - description: P2P_ptp-tests-spine2_Ethernet8 ptp: announce: interval: 0 @@ -254,6 +253,7 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + description: P2P_ptp-tests-spine2_Ethernet8 - name: Ethernet9 peer: ptp-tests-spine2 peer_interface: Ethernet9 @@ -262,7 +262,6 @@ ethernet_interfaces: enabled: false shutdown: false mtu: 9214 - description: P2P_ptp-tests-spine2_Ethernet9 ptp: announce: interval: 0 @@ -272,6 +271,7 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + description: P2P_ptp-tests-spine2_Ethernet9 loopback_interfaces: - name: Loopback0 description: ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml index 1d8ce63aca5..c555572bccb 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/ptp-tests-spine2.yml @@ -135,7 +135,6 @@ ethernet_interfaces: enabled: false shutdown: false mtu: 9214 - description: P2P_ptp-tests-spine1_Ethernet6 ptp: announce: interval: 2 @@ -145,6 +144,7 @@ ethernet_interfaces: interval: 2 transport: ipv4 enable: true + description: P2P_ptp-tests-spine1_Ethernet6 - name: Ethernet7 peer: ptp-tests-spine1 peer_interface: Ethernet7 @@ -153,7 +153,6 @@ ethernet_interfaces: enabled: false shutdown: false mtu: 9214 - description: P2P_ptp-tests-spine1_Ethernet7 ptp: announce: interval: 0 @@ -163,6 +162,7 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + description: P2P_ptp-tests-spine1_Ethernet7 - name: Ethernet8 peer: ptp-tests-spine1 peer_interface: Ethernet8 @@ -171,7 +171,6 @@ ethernet_interfaces: enabled: false shutdown: false mtu: 9214 - description: P2P_ptp-tests-spine1_Ethernet8 ptp: announce: interval: 0 @@ -181,6 +180,7 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + description: P2P_ptp-tests-spine1_Ethernet8 - name: Ethernet9 peer: ptp-tests-spine1 peer_interface: Ethernet9 @@ -189,7 +189,6 @@ ethernet_interfaces: enabled: false shutdown: false mtu: 9214 - description: P2P_ptp-tests-spine1_Ethernet9 ptp: announce: interval: 0 @@ -199,5 +198,6 @@ ethernet_interfaces: interval: -3 transport: ipv4 enable: true + description: P2P_ptp-tests-spine1_Ethernet9 metadata: platform: vEOS-LAB diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/l3_edge_bgp.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/l3_edge_bgp.yml index 34bbc14621e..e0655ba14cb 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/l3_edge_bgp.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/l3_edge_bgp.yml @@ -2,6 +2,8 @@ type: spine spine: nodes: - name: l3_edge_bgp + ptp: + enabled: true id: 1 evpn_role: "none" loopback_ipv4_pool: 1.2.3.4/24 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/l3_edge_isis.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/l3_edge_isis.yml index 4d9c4718363..da27d83db12 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/l3_edge_isis.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/l3_edge_isis.yml @@ -8,6 +8,8 @@ type: spine spine: nodes: - name: l3_edge_isis + ptp: + enabled: true id: 1 evpn_role: "none" loopback_ipv4_pool: 1.2.3.4/24 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/l3_edge_ospf.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/l3_edge_ospf.yml index 4984a58bbad..8239bd5e829 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/l3_edge_ospf.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/l3_edge_ospf.yml @@ -4,6 +4,8 @@ type: spine spine: nodes: - name: l3_edge_ospf + ptp: + enabled: true id: 1 evpn_role: "none" loopback_ipv4_pool: 1.2.3.4/24 diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/port_channel_interfaces.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/port_channel_interfaces.py index 2d243936d8f..b69ca8a2f7e 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/port_channel_interfaces.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/port_channel_interfaces.py @@ -37,9 +37,6 @@ def port_channel_interfaces(self: AvdStructuredConfigCoreInterfacesAndL3Edge) -> # Remove None values port_channel_interface = {key: value for key, value in port_channel_interface.items() if value is not None} - if get(p2p_link, "ptp.enabled") and (ptp_config := self._get_interface_ptp_config(p2p_link)) is not None: - port_channel_interface["ptp"] = ptp_config - port_channel_interfaces.append(port_channel_interface) if port_channel_interfaces: diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py index ade6a46e5c1..f6ceec92ef7 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py @@ -227,6 +227,26 @@ def _get_common_interface_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, if (ip := get(p2p_link, "ip")) is not None: interface_cfg["ip_address"] = ip[index] + if get(p2p_link, "ptp.enabled"): + ptp_config = {} + # Apply PTP profile config from node settings when profile is not defined on p2p_link + if (ptp_profile_name := get(p2p_link, "ptp.profile")) is None: + ptp_config.update(self.shared_utils.ptp_profile) + + # Apply PTP profile defined for the p2p_link + else: + msg = f"PTP Profile '{ptp_profile_name}' referenced under {self.data_model}.p2p_links does not exist in `ptp_profiles`." + ptp_config.update(get_item(self.shared_utils.ptp_profiles, "profile", ptp_profile_name, required=True, custom_error_msg=msg)) + + node_index = p2p_link["nodes"].index(self.shared_utils.hostname) + if (ptp_roles := get(p2p_link, "ptp.roles")) and len(ptp_roles) > node_index and ptp_roles[node_index] == "master": + ptp_config["role"] = "master" + + ptp_config["enable"] = True + ptp_config.pop("profile", None) + + interface_cfg["ptp"] = ptp_config + if p2p_link.get("include_in_underlay_protocol", True) is True: if p2p_link.get("underlay_multicast", False) and self.shared_utils.underlay_multicast is True: interface_cfg["pim"] = {"ipv4": {"sparse_mode": True}} @@ -302,12 +322,6 @@ def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link """ ethernet_cfg = {"speed": p2p_link.get("speed")} - if get(p2p_link, "port_channel") is not None: - return ethernet_cfg - - if get(p2p_link, "ptp.enabled") is True and (ptp_config := self._get_interface_ptp_config(p2p_link)): - ethernet_cfg["ptp"] = ptp_config - return ethernet_cfg def _get_port_channel_member_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link: dict, member: dict) -> dict: @@ -327,30 +341,3 @@ def _get_port_channel_member_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edg "mode": get(p2p_link, "port_channel.mode", default="active"), }, } - - def _get_interface_ptp_config(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link: dict) -> dict: - """ - Return partial structured_config for one p2p_link. - - Covers PTP config for ethernet and port channel interfaces - """ - ptp_config = {} - - if self.shared_utils.ptp_enabled and get(p2p_link, "ptp.enabled"): - # Apply PTP profile config from node settings when profile is not defined on p2p_link - if (ptp_profile_name := get(p2p_link, "ptp.profile")) is None: - ptp_config.update(self.shared_utils.ptp_profile) - - # Apply PTP profile defined for the p2p_link - else: - msg = f"PTP Profile '{ptp_profile_name}' referenced under {self.data_model}.p2p_links does not exist in `ptp_profiles`." - ptp_config.update(get_item(self.shared_utils.ptp_profiles, "profile", ptp_profile_name, required=True, custom_error_msg=msg)) - - node_index = p2p_link["nodes"].index(self.shared_utils.hostname) - if (ptp_roles := get(p2p_link, "ptp.roles")) and len(ptp_roles) > node_index and ptp_roles[node_index] == "master": - ptp_config["role"] = "master" - - ptp_config["enable"] = True - ptp_config.pop("profile", None) - - return ptp_config From f5685d0188e8efeed218e1eaddab5aaec388e028 Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Fri, 22 Nov 2024 14:24:38 +0530 Subject: [PATCH 24/30] FIX CI --- .../structured_config/core_interfaces_and_l3_edge/utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py index f6ceec92ef7..de48c508949 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py @@ -320,9 +320,7 @@ def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link Covers config that is only applicable to ethernet interfaces. This config will only be used on both main interfaces and port-channel members. """ - ethernet_cfg = {"speed": p2p_link.get("speed")} - - return ethernet_cfg + return {"speed": p2p_link.get("speed")} def _get_port_channel_member_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link: dict, member: dict) -> dict: """ From 4069c9b24cd60bab5c6f1297567a8b89d94d3510 Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Mon, 25 Nov 2024 09:56:13 +0530 Subject: [PATCH 25/30] Fix --- .../documentation/devices/DC1-POD1-LEAF2B.md | 5 ----- .../documentation/devices/DC1-POD2-SPINE2.md | 5 ----- .../documentation/devices/DC1-SUPER-SPINE1.md | 5 ----- .../documentation/devices/DC2-POD1-LEAF1A.md | 5 ----- .../documentation/devices/DC2-POD1-SPINE2.md | 5 ----- .../documentation/devices/DC2-SUPER-SPINE1.md | 5 ----- .../intended/configs/DC1-POD1-LEAF2B.cfg | 5 ----- .../intended/configs/DC1-POD2-SPINE2.cfg | 5 ----- .../intended/configs/DC1-SUPER-SPINE1.cfg | 5 ----- .../intended/configs/DC2-POD1-LEAF1A.cfg | 5 ----- .../intended/configs/DC2-POD1-SPINE2.cfg | 5 ----- .../intended/configs/DC2-SUPER-SPINE1.cfg | 5 ----- .../structured_configs/DC1-POD1-LEAF2B.yml | 7 ------- .../structured_configs/DC1-POD2-SPINE2.yml | 7 ------- .../structured_configs/DC1-SUPER-SPINE1.yml | 7 ------- .../structured_configs/DC2-POD1-LEAF1A.yml | 7 ------- .../structured_configs/DC2-POD1-SPINE2.yml | 7 ------- .../structured_configs/DC2-SUPER-SPINE1.yml | 7 ------- .../core_interfaces_and_l3_edge/utils.py | 18 ++++++++++-------- 19 files changed, 10 insertions(+), 110 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md index da852c81ba7..51901414dc5 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD1-LEAF2B.md @@ -359,11 +359,6 @@ interface Ethernet7 no switchport ip address 11.1.0.38/31 ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 - ptp sync-message interval -3 - ptp transport ipv4 ! interface Ethernet11 description P2P_DC1-POD1-SPINE1_Ethernet8 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md index d45b29beb76..0bcb11606b7 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-POD2-SPINE2.md @@ -215,11 +215,6 @@ interface Ethernet4 no switchport ip address 200.200.200.101/24 ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 - ptp sync-message interval -3 - ptp transport ipv4 ``` ### Loopback Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md index 7383876048b..6888c94e063 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC1-SUPER-SPINE1.md @@ -204,11 +204,6 @@ interface Ethernet6 ip address 11.1.2.0/31 mac security profile MACSEC_PROFILE ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 - ptp sync-message interval -3 - ptp transport ipv4 ``` ### Loopback Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md index e37247d5ca3..1e0264a2bef 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-LEAF1A.md @@ -263,11 +263,6 @@ interface Ethernet7 no switchport ip address 11.1.0.39/31 ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 - ptp sync-message interval -3 - ptp transport ipv4 ``` ### Port-Channel Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md index 95b9a4dfeae..210db623f3d 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-POD1-SPINE2.md @@ -219,11 +219,6 @@ interface Ethernet5 no switchport ip address 200.200.200.201/24 ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 - ptp sync-message interval -3 - ptp transport ipv4 ``` ### Loopback Interfaces diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md index 542107ae774..d9f4c11a72b 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/documentation/devices/DC2-SUPER-SPINE1.md @@ -215,11 +215,6 @@ interface Ethernet4 ip address 11.1.2.1/31 mac security profile MACSEC_PROFILE ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 - ptp sync-message interval -3 - ptp transport ipv4 ! interface Ethernet5 description P2P_DC2-RS2_Ethernet1 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg index ad0d02ff69d..b3dd44286bf 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD1-LEAF2B.cfg @@ -178,11 +178,6 @@ interface Ethernet7 no switchport ip address 11.1.0.38/31 ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 - ptp sync-message interval -3 - ptp transport ipv4 ! interface Ethernet11 description P2P_DC1-POD1-SPINE1_Ethernet8 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg index b7d5e2d8066..dd68564c565 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-POD2-SPINE2.cfg @@ -58,11 +58,6 @@ interface Ethernet4 no switchport ip address 200.200.200.101/24 ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 - ptp sync-message interval -3 - ptp transport ipv4 ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg index 149b7cb4328..4a33013d7db 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC1-SUPER-SPINE1.cfg @@ -75,11 +75,6 @@ interface Ethernet6 ip address 11.1.2.0/31 mac security profile MACSEC_PROFILE ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 - ptp sync-message interval -3 - ptp transport ipv4 ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg index e0a095ce697..e2defc66107 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-LEAF1A.cfg @@ -79,11 +79,6 @@ interface Ethernet7 no switchport ip address 11.1.0.39/31 ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 - ptp sync-message interval -3 - ptp transport ipv4 ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg index cf3b05e5722..57de23b9a86 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-POD1-SPINE2.cfg @@ -63,11 +63,6 @@ interface Ethernet5 no switchport ip address 200.200.200.201/24 ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 - ptp sync-message interval -3 - ptp transport ipv4 ! interface Loopback0 description ROUTER_ID diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg index 4e778bcf4c8..56072e92586 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/configs/DC2-SUPER-SPINE1.cfg @@ -55,11 +55,6 @@ interface Ethernet4 ip address 11.1.2.1/31 mac security profile MACSEC_PROFILE ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 - ptp sync-message interval -3 - ptp transport ipv4 ! interface Ethernet5 description P2P_DC2-RS2_Ethernet1 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml index aed209b1837..526b00d4e6e 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD1-LEAF2B.yml @@ -657,13 +657,6 @@ ethernet_interfaces: shutdown: false ip_address: 11.1.0.38/31 ptp: - announce: - interval: 0 - timeout: 3 - delay_req: -3 - sync_message: - interval: -3 - transport: ipv4 enable: true description: P2P_DC2-POD1-LEAF1A_Ethernet7 - name: Ethernet16 diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml index 9c8d9db31b8..17a6788893d 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-POD2-SPINE2.yml @@ -171,13 +171,6 @@ ethernet_interfaces: shutdown: false ip_address: 200.200.200.101/24 ptp: - announce: - interval: 0 - timeout: 3 - delay_req: -3 - sync_message: - interval: -3 - transport: ipv4 enable: true description: P2P_DC2-POD1-SPINE2_Ethernet5 loopback_interfaces: diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml index d36b7ed23a2..27038c9dc76 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC1-SUPER-SPINE1.yml @@ -171,13 +171,6 @@ ethernet_interfaces: shutdown: false ip_address: 11.1.2.0/31 ptp: - announce: - interval: 0 - timeout: 3 - delay_req: -3 - sync_message: - interval: -3 - transport: ipv4 enable: true mac_security: profile: MACSEC_PROFILE diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml index fbb46856e09..ac9c882368f 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-LEAF1A.yml @@ -273,13 +273,6 @@ ethernet_interfaces: shutdown: false ip_address: 11.1.0.39/31 ptp: - announce: - interval: 0 - timeout: 3 - delay_req: -3 - sync_message: - interval: -3 - transport: ipv4 enable: true description: P2P_DC1-POD1-LEAF2B_Ethernet7 port_channel_interfaces: diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml index 3f22c2ffde6..4e078c6f6b4 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-POD1-SPINE2.yml @@ -155,13 +155,6 @@ ethernet_interfaces: shutdown: false ip_address: 200.200.200.201/24 ptp: - announce: - interval: 0 - timeout: 3 - delay_req: -3 - sync_message: - interval: -3 - transport: ipv4 enable: true description: P2P_DC1-POD2-SPINE2_Ethernet4 loopback_interfaces: diff --git a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml index 3ed3f782c36..8b57c19048f 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs-twodc-5stage-clos/intended/structured_configs/DC2-SUPER-SPINE1.yml @@ -220,13 +220,6 @@ ethernet_interfaces: shutdown: false ip_address: 11.1.2.1/31 ptp: - announce: - interval: 0 - timeout: 3 - delay_req: -3 - sync_message: - interval: -3 - transport: ipv4 enable: true mac_security: profile: MACSEC_PROFILE diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py index de48c508949..47ebd6d7d35 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py @@ -229,14 +229,16 @@ def _get_common_interface_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, if get(p2p_link, "ptp.enabled"): ptp_config = {} - # Apply PTP profile config from node settings when profile is not defined on p2p_link - if (ptp_profile_name := get(p2p_link, "ptp.profile")) is None: - ptp_config.update(self.shared_utils.ptp_profile) - - # Apply PTP profile defined for the p2p_link - else: - msg = f"PTP Profile '{ptp_profile_name}' referenced under {self.data_model}.p2p_links does not exist in `ptp_profiles`." - ptp_config.update(get_item(self.shared_utils.ptp_profiles, "profile", ptp_profile_name, required=True, custom_error_msg=msg)) + + if self.shared_utils.ptp_enabled: + # Apply PTP profile config from node settings when profile is not defined on p2p_link + if (ptp_profile_name := get(p2p_link, "ptp.profile")) is None: + ptp_config.update(self.shared_utils.ptp_profile) + + # Apply PTP profile defined for the p2p_link + else: + msg = f"PTP Profile '{ptp_profile_name}' referenced under {self.data_model}.p2p_links does not exist in `ptp_profiles`." + ptp_config.update(get_item(self.shared_utils.ptp_profiles, "profile", ptp_profile_name, required=True, custom_error_msg=msg)) node_index = p2p_link["nodes"].index(self.shared_utils.hostname) if (ptp_roles := get(p2p_link, "ptp.roles")) and len(ptp_roles) > node_index and ptp_roles[node_index] == "master": From faf209e72e36ce956f574de41cd563e1cfc2eb89 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 06:11:46 +0000 Subject: [PATCH 26/30] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../pyavd/_eos_designs/schema/__init__.py | 263 ++++++++++++++++-- 1 file changed, 243 insertions(+), 20 deletions(-) diff --git a/python-avd/pyavd/_eos_designs/schema/__init__.py b/python-avd/pyavd/_eos_designs/schema/__init__.py index afa5548636b..f09a8d0de5e 100644 --- a/python-avd/pyavd/_eos_designs/schema/__init__.py +++ b/python-avd/pyavd/_eos_designs/schema/__init__.py @@ -1026,18 +1026,51 @@ class Descriptions(AvdList[str]): class Ptp(AvdModel): """Subclass of AvdModel.""" - _fields: ClassVar[dict] = {"enabled": {"type": bool, "default": False}, "_custom_data": {"type": dict}} + class Roles(AvdList[str]): + """Subclass of AvdList with `str` items.""" + + Roles._item_type = str + + _fields: ClassVar[dict] = { + "enabled": {"type": bool, "default": False}, + "roles": {"type": Roles}, + "profile": {"type": str, "default": "aes67-r16-2016"}, + "_custom_data": {"type": dict}, + } enabled: bool """ Enable PTP. Default value: `False` """ + roles: Roles + """ + Role in boundary clock mode for each node. Default is `dynamic`. + + Subclass of AvdList with `str` + items. + """ + profile: str + """ + Default available profiles are: + - "aes67" + - "aes67-r16-2016" + - "smpte2059-2" + + Default value: `"aes67-r16-2016"` + """ _custom_data: dict[str, Any] if TYPE_CHECKING: - def __init__(self, *, enabled: bool | UndefinedType = Undefined, _custom_data: dict[str, Any] | UndefinedType = Undefined) -> None: + def __init__( + self, + *, + enabled: bool | UndefinedType = Undefined, + roles: Roles | UndefinedType = Undefined, + profile: str | UndefinedType = Undefined, + _custom_data: dict[str, Any] | UndefinedType = Undefined, + ) -> None: """ Ptp. @@ -1046,6 +1079,16 @@ def __init__(self, *, enabled: bool | UndefinedType = Undefined, _custom_data: d Args: enabled: Enable PTP. + roles: + Role in boundary clock mode for each node. Default is `dynamic`. + + Subclass of AvdList with `str` + items. + profile: + Default available profiles are: + - "aes67" + - "aes67-r16-2016" + - "smpte2059-2" _custom_data: _custom_data """ @@ -1556,18 +1599,51 @@ class Descriptions(AvdList[str]): class Ptp(AvdModel): """Subclass of AvdModel.""" - _fields: ClassVar[dict] = {"enabled": {"type": bool, "default": False}, "_custom_data": {"type": dict}} + class Roles(AvdList[str]): + """Subclass of AvdList with `str` items.""" + + Roles._item_type = str + + _fields: ClassVar[dict] = { + "enabled": {"type": bool, "default": False}, + "roles": {"type": Roles}, + "profile": {"type": str, "default": "aes67-r16-2016"}, + "_custom_data": {"type": dict}, + } enabled: bool """ Enable PTP. Default value: `False` """ + roles: Roles + """ + Role in boundary clock mode for each node. Default is `dynamic`. + + Subclass of AvdList with `str` + items. + """ + profile: str + """ + Default available profiles are: + - "aes67" + - "aes67-r16-2016" + - "smpte2059-2" + + Default value: `"aes67-r16-2016"` + """ _custom_data: dict[str, Any] if TYPE_CHECKING: - def __init__(self, *, enabled: bool | UndefinedType = Undefined, _custom_data: dict[str, Any] | UndefinedType = Undefined) -> None: + def __init__( + self, + *, + enabled: bool | UndefinedType = Undefined, + roles: Roles | UndefinedType = Undefined, + profile: str | UndefinedType = Undefined, + _custom_data: dict[str, Any] | UndefinedType = Undefined, + ) -> None: """ Ptp. @@ -1576,6 +1652,16 @@ def __init__(self, *, enabled: bool | UndefinedType = Undefined, _custom_data: d Args: enabled: Enable PTP. + roles: + Role in boundary clock mode for each node. Default is `dynamic`. + + Subclass of AvdList with `str` + items. + profile: + Default available profiles are: + - "aes67" + - "aes67-r16-2016" + - "smpte2059-2" _custom_data: _custom_data """ @@ -5079,18 +5165,51 @@ class Descriptions(AvdList[str]): class Ptp(AvdModel): """Subclass of AvdModel.""" - _fields: ClassVar[dict] = {"enabled": {"type": bool, "default": False}, "_custom_data": {"type": dict}} + class Roles(AvdList[str]): + """Subclass of AvdList with `str` items.""" + + Roles._item_type = str + + _fields: ClassVar[dict] = { + "enabled": {"type": bool, "default": False}, + "roles": {"type": Roles}, + "profile": {"type": str, "default": "aes67-r16-2016"}, + "_custom_data": {"type": dict}, + } enabled: bool """ Enable PTP. Default value: `False` """ + roles: Roles + """ + Role in boundary clock mode for each node. Default is `dynamic`. + + Subclass of AvdList with `str` + items. + """ + profile: str + """ + Default available profiles are: + - "aes67" + - "aes67-r16-2016" + - "smpte2059-2" + + Default value: `"aes67-r16-2016"` + """ _custom_data: dict[str, Any] if TYPE_CHECKING: - def __init__(self, *, enabled: bool | UndefinedType = Undefined, _custom_data: dict[str, Any] | UndefinedType = Undefined) -> None: + def __init__( + self, + *, + enabled: bool | UndefinedType = Undefined, + roles: Roles | UndefinedType = Undefined, + profile: str | UndefinedType = Undefined, + _custom_data: dict[str, Any] | UndefinedType = Undefined, + ) -> None: """ Ptp. @@ -5099,6 +5218,16 @@ def __init__(self, *, enabled: bool | UndefinedType = Undefined, _custom_data: d Args: enabled: Enable PTP. + roles: + Role in boundary clock mode for each node. Default is `dynamic`. + + Subclass of AvdList with `str` + items. + profile: + Default available profiles are: + - "aes67" + - "aes67-r16-2016" + - "smpte2059-2" _custom_data: _custom_data """ @@ -5609,18 +5738,51 @@ class Descriptions(AvdList[str]): class Ptp(AvdModel): """Subclass of AvdModel.""" - _fields: ClassVar[dict] = {"enabled": {"type": bool, "default": False}, "_custom_data": {"type": dict}} + class Roles(AvdList[str]): + """Subclass of AvdList with `str` items.""" + + Roles._item_type = str + + _fields: ClassVar[dict] = { + "enabled": {"type": bool, "default": False}, + "roles": {"type": Roles}, + "profile": {"type": str, "default": "aes67-r16-2016"}, + "_custom_data": {"type": dict}, + } enabled: bool """ Enable PTP. Default value: `False` """ + roles: Roles + """ + Role in boundary clock mode for each node. Default is `dynamic`. + + Subclass of AvdList with `str` + items. + """ + profile: str + """ + Default available profiles are: + - "aes67" + - "aes67-r16-2016" + - "smpte2059-2" + + Default value: `"aes67-r16-2016"` + """ _custom_data: dict[str, Any] if TYPE_CHECKING: - def __init__(self, *, enabled: bool | UndefinedType = Undefined, _custom_data: dict[str, Any] | UndefinedType = Undefined) -> None: + def __init__( + self, + *, + enabled: bool | UndefinedType = Undefined, + roles: Roles | UndefinedType = Undefined, + profile: str | UndefinedType = Undefined, + _custom_data: dict[str, Any] | UndefinedType = Undefined, + ) -> None: """ Ptp. @@ -5629,6 +5791,16 @@ def __init__(self, *, enabled: bool | UndefinedType = Undefined, _custom_data: d Args: enabled: Enable PTP. + roles: + Role in boundary clock mode for each node. Default is `dynamic`. + + Subclass of AvdList with `str` + items. + profile: + Default available profiles are: + - "aes67" + - "aes67-r16-2016" + - "smpte2059-2" _custom_data: _custom_data """ @@ -6825,8 +6997,18 @@ class Ptp(AvdModel): } enabled: bool """Default value: `False`""" - endpoint_role: Literal["bmca", "default", "follower"] - """Default value: `"follower"`""" + endpoint_role: Literal["follower", "dynamic", "bmca", "default"] + """ + PTP role of the endpoint. + `follower` will configure the switch port as `ptp role master`. + `dynamic` + will use BMCA. + `default` is deprecated in favor of `follower`. + `bmca` is deprecated in favor of + `dynamic`. + + Default value: `"follower"` + """ profile: str """ Default available profiles are: @@ -6844,7 +7026,7 @@ def __init__( self, *, enabled: bool | UndefinedType = Undefined, - endpoint_role: Literal["bmca", "default", "follower"] | UndefinedType = Undefined, + endpoint_role: Literal["follower", "dynamic", "bmca", "default"] | UndefinedType = Undefined, profile: str | UndefinedType = Undefined, _custom_data: dict[str, Any] | UndefinedType = Undefined, ) -> None: @@ -6856,7 +7038,14 @@ def __init__( Args: enabled: enabled - endpoint_role: endpoint_role + endpoint_role: + PTP role of the endpoint. + `follower` will configure the switch port as `ptp role master`. + `dynamic` + will use BMCA. + `default` is deprecated in favor of `follower`. + `bmca` is deprecated in favor of + `dynamic`. profile: Default available profiles are: - "aes67" @@ -10664,8 +10853,18 @@ class Ptp(AvdModel): } enabled: bool """Default value: `False`""" - endpoint_role: Literal["bmca", "default", "follower"] - """Default value: `"follower"`""" + endpoint_role: Literal["follower", "dynamic", "bmca", "default"] + """ + PTP role of the endpoint. + `follower` will configure the switch port as `ptp role master`. + `dynamic` + will use BMCA. + `default` is deprecated in favor of `follower`. + `bmca` is deprecated in favor of + `dynamic`. + + Default value: `"follower"` + """ profile: str """ Default available profiles are: @@ -10683,7 +10882,7 @@ def __init__( self, *, enabled: bool | UndefinedType = Undefined, - endpoint_role: Literal["bmca", "default", "follower"] | UndefinedType = Undefined, + endpoint_role: Literal["follower", "dynamic", "bmca", "default"] | UndefinedType = Undefined, profile: str | UndefinedType = Undefined, _custom_data: dict[str, Any] | UndefinedType = Undefined, ) -> None: @@ -10695,7 +10894,14 @@ def __init__( Args: enabled: enabled - endpoint_role: endpoint_role + endpoint_role: + PTP role of the endpoint. + `follower` will configure the switch port as `ptp role master`. + `dynamic` + will use BMCA. + `default` is deprecated in favor of `follower`. + `bmca` is deprecated in favor of + `dynamic`. profile: Default available profiles are: - "aes67" @@ -17657,8 +17863,18 @@ class Ptp(AvdModel): } enabled: bool """Default value: `False`""" - endpoint_role: Literal["bmca", "default", "follower"] - """Default value: `"follower"`""" + endpoint_role: Literal["follower", "dynamic", "bmca", "default"] + """ + PTP role of the endpoint. + `follower` will configure the switch port as `ptp role master`. + `dynamic` + will use BMCA. + `default` is deprecated in favor of `follower`. + `bmca` is deprecated in favor of + `dynamic`. + + Default value: `"follower"` + """ profile: str """ Default available profiles are: @@ -17676,7 +17892,7 @@ def __init__( self, *, enabled: bool | UndefinedType = Undefined, - endpoint_role: Literal["bmca", "default", "follower"] | UndefinedType = Undefined, + endpoint_role: Literal["follower", "dynamic", "bmca", "default"] | UndefinedType = Undefined, profile: str | UndefinedType = Undefined, _custom_data: dict[str, Any] | UndefinedType = Undefined, ) -> None: @@ -17688,7 +17904,14 @@ def __init__( Args: enabled: enabled - endpoint_role: endpoint_role + endpoint_role: + PTP role of the endpoint. + `follower` will configure the switch port as `ptp role master`. + `dynamic` + will use BMCA. + `default` is deprecated in favor of `follower`. + `bmca` is deprecated in favor of + `dynamic`. profile: Default available profiles are: - "aes67" From e4ed51c02d5a93fbb74060c27fda866fdf0b61ea Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Thu, 28 Nov 2024 15:28:29 +0530 Subject: [PATCH 27/30] Use latest code format --- .../host_vars/custom-ptp-profile.yml | 1 + .../connected_endpoints/utils.py | 2 +- .../core_interfaces_and_l3_edge/utils.py | 19 +++++++++++-------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/custom-ptp-profile.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/custom-ptp-profile.yml index fbd45d54bd4..37eb8f780a4 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/custom-ptp-profile.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/host_vars/custom-ptp-profile.yml @@ -18,6 +18,7 @@ l3_edge: interfaces: [ Ethernet8, Ethernet8 ] ptp: enabled: true + profile: my-custom-ptp-profile include_in_underlay_protocol: false ptp_settings: diff --git a/python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/utils.py b/python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/utils.py index 82a78047f45..820b6d3af4e 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/utils.py @@ -226,7 +226,7 @@ def _get_adapter_ptp( ptp_config["enable"] = True - if get(adapter, "ptp.endpoint_role") not in ["dynamic", "bmca"]: + if adapter.ptp.endpoint_role not in ["dynamic", "bmca"]: ptp_config["role"] = "master" ptp_config.pop("profile", None) diff --git a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py index 64e1cf443cf..4daf1196b12 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py +++ b/python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py @@ -211,21 +211,24 @@ def _get_common_interface_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, if p2p_link.ip: interface_cfg["ip_address"] = p2p_link.ip[index] - if get(p2p_link, "ptp.enabled"): + if p2p_link.ptp.enabled: ptp_config = {} if self.shared_utils.ptp_enabled: # Apply PTP profile config from node settings when profile is not defined on p2p_link - if (ptp_profile_name := get(p2p_link, "ptp.profile")) is None: - ptp_config.update(self.shared_utils.ptp_profile) + if not p2p_link.ptp.profile: + ptp_config.update(self.shared_utils.ptp_profile._as_dict(include_default_values=True)) # Apply PTP profile defined for the p2p_link + elif p2p_link.ptp.profile not in self.inputs.ptp_profiles: + msg = f"PTP Profile '{p2p_link.ptp.profile}' referenced under {self.data_model}.p2p_links does not exist in `ptp_profiles`." + raise AristaAvdInvalidInputsError(msg) + else: - msg = f"PTP Profile '{ptp_profile_name}' referenced under {self.data_model}.p2p_links does not exist in `ptp_profiles`." - ptp_config.update(get_item(self.shared_utils.ptp_profiles, "profile", ptp_profile_name, required=True, custom_error_msg=msg)) + ptp_config.update(self.inputs.ptp_profiles[p2p_link.ptp.profile]._as_dict(include_default_values=True)) - node_index = p2p_link["nodes"].index(self.shared_utils.hostname) - if (ptp_roles := get(p2p_link, "ptp.roles")) and len(ptp_roles) > node_index and ptp_roles[node_index] == "master": + node_index = p2p_link.nodes._as_list().index(self.shared_utils.hostname) # TODO: Implement .index() method on AvdList and AvdIndexedList class. + if len(p2p_link.ptp.roles) > node_index and p2p_link.ptp.roles[node_index] == "master": ptp_config["role"] = "master" ptp_config["enable"] = True @@ -293,7 +296,7 @@ def _get_ethernet_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link Covers config that is only applicable to ethernet interfaces. This config will only be used on both main interfaces and port-channel members. """ - return {"speed": p2p_link.get("speed")} + return {"speed": p2p_link.speed} def _get_port_channel_member_cfg(self: AvdStructuredConfigCoreInterfacesAndL3Edge, p2p_link: T_P2pLinksItem, p2p_link_data: dict, member: dict) -> dict: """ From 2bdf6e59f7a92f551b9ee4dfb15687c75dac02f8 Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Wed, 11 Dec 2024 16:47:00 +0530 Subject: [PATCH 28/30] Add deprecated keys test --- .../intended/configs/host3.cfg | 44 ++++++++++++++ .../intended/structured_configs/host3.yml | 57 +++++++++++++++++++ .../host_vars/host3/connected_endpoints.yml | 14 +++++ .../inventory/host_vars/host3/node_type.yml | 7 +++ .../inventory/hosts.yml | 1 + 5 files changed, 123 insertions(+) create mode 100644 ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/configs/host3.cfg create mode 100644 ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/structured_configs/host3.yml create mode 100644 ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/host3/connected_endpoints.yml create mode 100644 ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/host3/node_type.yml diff --git a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/configs/host3.cfg b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/configs/host3.cfg new file mode 100644 index 00000000000..d9a896d698f --- /dev/null +++ b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/configs/host3.cfg @@ -0,0 +1,44 @@ +! +no enable password +no aaa root +! +vlan internal order ascending range 1006 1199 +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname host3 +! +vrf instance MGMT +! +management api http-commands + protocol https + no shutdown + ! + vrf MGMT + no shutdown +! +interface Port-Channel1 + description SERVER_OLD_SW-1/2_ENDPOINT_PORT_CHANNEL + no shutdown + switchport + ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 +! +interface Ethernet1 + description SERVER_OLD_SW-1/2_Endpoint_port1 + no shutdown + channel-group 1 mode active +! +interface Ethernet2 + description SERVER_OLD_SW-1/2_ENDPOINT_PORT2 + no shutdown + channel-group 1 mode active +no ip routing vrf MGMT +! +end diff --git a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/structured_configs/host3.yml b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/structured_configs/host3.yml new file mode 100644 index 00000000000..b38ab175d57 --- /dev/null +++ b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/structured_configs/host3.yml @@ -0,0 +1,57 @@ +hostname: host3 +is_deployed: true +service_routing_protocols_model: multi-agent +vlan_internal_order: + allocation: ascending + range: + beginning: 1006 + ending: 1199 +aaa_root: + disabled: true +config_end: true +enable_password: + disabled: true +transceiver_qsfp_default_mode_4x10: true +vrfs: +- name: MGMT + ip_routing: false +management_api_http: + enable_vrfs: + - name: MGMT + enable_https: true +ip_igmp_snooping: + globally_enabled: true +ethernet_interfaces: +- name: Ethernet1 + peer: OLD_SW-1/2 + peer_interface: Endpoint_port1 + peer_type: server + description: SERVER_OLD_SW-1/2_Endpoint_port1 + shutdown: false + channel_group: + id: 1 + mode: active +- name: Ethernet2 + peer: OLD_SW-1/2 + peer_interface: ENDPOINT_PORT2 + peer_type: server + description: SERVER_OLD_SW-1/2_ENDPOINT_PORT2 + shutdown: false + channel_group: + id: 1 + mode: active +port_channel_interfaces: +- name: Port-Channel1 + description: SERVER_OLD_SW-1/2_ENDPOINT_PORT_CHANNEL + shutdown: false + ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 + enable: true + switchport: + enabled: true diff --git a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/host3/connected_endpoints.yml b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/host3/connected_endpoints.yml new file mode 100644 index 00000000000..37120d74ad0 --- /dev/null +++ b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/host3/connected_endpoints.yml @@ -0,0 +1,14 @@ +--- +# Test deprecated key endpoint_role - bmca +servers: + - name: OLD_SW-1/2 + adapters: + - switches: [host3, host3] + switch_ports: [Ethernet1, Ethernet2] + endpoint_ports: [Endpoint_port1, ENDPOINT_PORT2] + port_channel: + mode: "active" + endpoint_port_channel: ENDPOINT_PORT_CHANNEL + ptp: + enabled: true + endpoint_role: bmca diff --git a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/host3/node_type.yml b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/host3/node_type.yml new file mode 100644 index 00000000000..e8317db38c4 --- /dev/null +++ b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/host3/node_type.yml @@ -0,0 +1,7 @@ +loopback_ipv4_pool: 192.168.0.0/24 + +type: l2leaf +l2leaf: + defaults: + nodes: + - name: host3 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/hosts.yml b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/hosts.yml index f4b55fa1a2d..5f50673f5ad 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/hosts.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/hosts.yml @@ -8,3 +8,4 @@ all: hosts: host1: host2: + host3: From 9f9fcfff71d58839e343db74b1279d309785f8bd Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Fri, 13 Dec 2024 12:34:51 +0530 Subject: [PATCH 29/30] Move deprecated test to exisiting nodes --- .../intended/configs/host1.cfg | 21 ++++++++++++ .../intended/structured_configs/host1.yml | 34 +++++++++++++++++++ .../connected-endpoints.yml} | 2 +- .../inventory/host_vars/host3/node_type.yml | 7 ---- .../inventory/hosts.yml | 1 - 5 files changed, 56 insertions(+), 9 deletions(-) rename ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/{host3/connected_endpoints.yml => host1/connected-endpoints.yml} (91%) delete mode 100644 ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/host3/node_type.yml diff --git a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/configs/host1.cfg b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/configs/host1.cfg index 63411758be5..cd8ed9f0f66 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/configs/host1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/configs/host1.cfg @@ -19,6 +19,27 @@ management api http-commands vrf MGMT no shutdown ! +interface Port-Channel1 + description SERVER_OLD_SW-1/2_ENDPOINT_PORT_CHANNEL + no shutdown + switchport + ptp enable + ptp announce interval 0 + ptp announce timeout 3 + ptp delay-req interval -3 + ptp sync-message interval -3 + ptp transport ipv4 +! +interface Ethernet1 + description SERVER_OLD_SW-1/2_Endpoint_port1 + no shutdown + channel-group 1 mode active +! +interface Ethernet2 + description SERVER_OLD_SW-1/2_ENDPOINT_PORT2 + no shutdown + channel-group 1 mode active +! interface Loopback0 description CUSTOM_ROUTER_ID no shutdown diff --git a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/structured_configs/host1.yml b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/structured_configs/host1.yml index 0e8dc9ceee6..df2428710de 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/structured_configs/host1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/structured_configs/host1.yml @@ -100,3 +100,37 @@ vxlan_interface: vxlan: udp_port: 4789 source_interface: Loopback1 +ethernet_interfaces: +- name: Ethernet1 + peer: OLD_SW-1/2 + peer_interface: Endpoint_port1 + peer_type: server + description: SERVER_OLD_SW-1/2_Endpoint_port1 + shutdown: false + channel_group: + id: 1 + mode: active +- name: Ethernet2 + peer: OLD_SW-1/2 + peer_interface: ENDPOINT_PORT2 + peer_type: server + description: SERVER_OLD_SW-1/2_ENDPOINT_PORT2 + shutdown: false + channel_group: + id: 1 + mode: active +port_channel_interfaces: +- name: Port-Channel1 + description: SERVER_OLD_SW-1/2_ENDPOINT_PORT_CHANNEL + shutdown: false + ptp: + announce: + interval: 0 + timeout: 3 + delay_req: -3 + sync_message: + interval: -3 + transport: ipv4 + enable: true + switchport: + enabled: true diff --git a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/host3/connected_endpoints.yml b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/host1/connected-endpoints.yml similarity index 91% rename from ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/host3/connected_endpoints.yml rename to ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/host1/connected-endpoints.yml index 37120d74ad0..5ba631de111 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/host3/connected_endpoints.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/host1/connected-endpoints.yml @@ -3,7 +3,7 @@ servers: - name: OLD_SW-1/2 adapters: - - switches: [host3, host3] + - switches: [host1, host1] switch_ports: [Ethernet1, Ethernet2] endpoint_ports: [Endpoint_port1, ENDPOINT_PORT2] port_channel: diff --git a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/host3/node_type.yml b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/host3/node_type.yml deleted file mode 100644 index e8317db38c4..00000000000 --- a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/host3/node_type.yml +++ /dev/null @@ -1,7 +0,0 @@ -loopback_ipv4_pool: 192.168.0.0/24 - -type: l2leaf -l2leaf: - defaults: - nodes: - - name: host3 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/hosts.yml b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/hosts.yml index 5f50673f5ad..f4b55fa1a2d 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/hosts.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/hosts.yml @@ -8,4 +8,3 @@ all: hosts: host1: host2: - host3: From f5ee81f9952bc88ae82bd0a217ff9f2f382172bd Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Fri, 13 Dec 2024 12:36:57 +0530 Subject: [PATCH 30/30] FIX CI --- .../intended/configs/host3.cfg | 44 -------------- .../intended/structured_configs/host3.yml | 57 ------------------- 2 files changed, 101 deletions(-) delete mode 100644 ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/configs/host3.cfg delete mode 100644 ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/structured_configs/host3.yml diff --git a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/configs/host3.cfg b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/configs/host3.cfg deleted file mode 100644 index d9a896d698f..00000000000 --- a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/configs/host3.cfg +++ /dev/null @@ -1,44 +0,0 @@ -! -no enable password -no aaa root -! -vlan internal order ascending range 1006 1199 -! -transceiver qsfp default-mode 4x10G -! -service routing protocols model multi-agent -! -hostname host3 -! -vrf instance MGMT -! -management api http-commands - protocol https - no shutdown - ! - vrf MGMT - no shutdown -! -interface Port-Channel1 - description SERVER_OLD_SW-1/2_ENDPOINT_PORT_CHANNEL - no shutdown - switchport - ptp enable - ptp announce interval 0 - ptp announce timeout 3 - ptp delay-req interval -3 - ptp sync-message interval -3 - ptp transport ipv4 -! -interface Ethernet1 - description SERVER_OLD_SW-1/2_Endpoint_port1 - no shutdown - channel-group 1 mode active -! -interface Ethernet2 - description SERVER_OLD_SW-1/2_ENDPOINT_PORT2 - no shutdown - channel-group 1 mode active -no ip routing vrf MGMT -! -end diff --git a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/structured_configs/host3.yml b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/structured_configs/host3.yml deleted file mode 100644 index b38ab175d57..00000000000 --- a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/structured_configs/host3.yml +++ /dev/null @@ -1,57 +0,0 @@ -hostname: host3 -is_deployed: true -service_routing_protocols_model: multi-agent -vlan_internal_order: - allocation: ascending - range: - beginning: 1006 - ending: 1199 -aaa_root: - disabled: true -config_end: true -enable_password: - disabled: true -transceiver_qsfp_default_mode_4x10: true -vrfs: -- name: MGMT - ip_routing: false -management_api_http: - enable_vrfs: - - name: MGMT - enable_https: true -ip_igmp_snooping: - globally_enabled: true -ethernet_interfaces: -- name: Ethernet1 - peer: OLD_SW-1/2 - peer_interface: Endpoint_port1 - peer_type: server - description: SERVER_OLD_SW-1/2_Endpoint_port1 - shutdown: false - channel_group: - id: 1 - mode: active -- name: Ethernet2 - peer: OLD_SW-1/2 - peer_interface: ENDPOINT_PORT2 - peer_type: server - description: SERVER_OLD_SW-1/2_ENDPOINT_PORT2 - shutdown: false - channel_group: - id: 1 - mode: active -port_channel_interfaces: -- name: Port-Channel1 - description: SERVER_OLD_SW-1/2_ENDPOINT_PORT_CHANNEL - shutdown: false - ptp: - announce: - interval: 0 - timeout: 3 - delay_req: -3 - sync_message: - interval: -3 - transport: ipv4 - enable: true - switchport: - enabled: true