diff --git a/models/enterprise_sonic/ptp_default_ds/deleted_example_01.txt b/models/enterprise_sonic/ptp_default_ds/deleted_example_01.txt new file mode 100644 index 00000000..787a8f0b --- /dev/null +++ b/models/enterprise_sonic/ptp_default_ds/deleted_example_01.txt @@ -0,0 +1,33 @@ +# Using deleted +# +# Before State: +# ------------- +# +# sonic# show running-configuration ptp +# ptp network-transport l2 multicast +# ptp domain 25 +# ptp domain-profile default +# ptp priority1 101 +# ptp priority2 91 +# ptp log-announce-interval 1 +# ptp log-sync-interval -3 +# sonic# + +- name: Delete specified PTP configurations + dellemc.enterprise_sonic.sonic_ptp: + config: + log-sync-interval: -3 + log-announce-interval: 1 + network-transport: 'L2' + unicast-multicast: 'multicast' + priority1: 101 + priority2: 91 + domain-number: 25 + state: deleted + +# After State: +# ------------ +# +# sonic# show running-configuration ptp +# ptp domain-profile default +# sonic# diff --git a/models/enterprise_sonic/ptp_default_ds/deleted_example_02.txt b/models/enterprise_sonic/ptp_default_ds/deleted_example_02.txt new file mode 100644 index 00000000..6d5c8f87 --- /dev/null +++ b/models/enterprise_sonic/ptp_default_ds/deleted_example_02.txt @@ -0,0 +1,30 @@ +# Using deleted +# +# Before State: +# ------------- +# +# sonic# show running-configuration ptp +# ptp mode boundary-clock +# ptp network-transport ipv6 unicast +# ptp domain 45 +# ptp domain-profile g8275.2 +# ptp announce-timeout 3 +# sonic# + +- name: Delete all PTP configurations + dellemc.enterprise_sonic.sonic_ptp: + config: + announce-receipt-timeout: 3 + network-transport: 'ipv6' + unicast-multicast: 'unicast' + domain-number: 45 + clock-type: 'BC' + domain-profile: 'G.8275.2' + state: deleted + +# After State: +# ------------ +# +# sonic# show running-configuration ptp + +# sonic# diff --git a/models/enterprise_sonic/ptp_default_ds/merged_example_01.txt b/models/enterprise_sonic/ptp_default_ds/merged_example_01.txt new file mode 100644 index 00000000..8b18dc96 --- /dev/null +++ b/models/enterprise_sonic/ptp_default_ds/merged_example_01.txt @@ -0,0 +1,38 @@ +# Using merged +# +# Before State: +# ------------- +# +# sonic# show running-configuration ptp +# ptp domain 35 +# ptp domain-profile default +# ptp priority2 100 +# sonic# + +- name: Merge provided global PTP configurations + dellemc.enterprise_sonic.sonic_ptp: + config: + domain-profile: 'G.8275.1' + log-sync-interval: -4 + log-announce-interval: -3 + announce-receipt-timeout: 5 + log-min-delay-req-interval: -4 + clock-type: 'BC' + network-transport: 'L2' + unicast-multicast: 'multicast' + state: merged + +# After State: +# ------------ +# +# sonic# show running-configuration ptp +# ptp mode boundary-clock +# ptp network-transport l2 multicast +# ptp domain 35 +# ptp domain-profile g8275.1 +# ptp priority2 100 +# ptp log-announce-interval -3 +# ptp announce-timeout 5 +# ptp log-sync-interval -4 +# ptp log-min-delay-req-interval -4 +# sonic# diff --git a/models/enterprise_sonic/ptp_default_ds/overridden_example_01.txt b/models/enterprise_sonic/ptp_default_ds/overridden_example_01.txt new file mode 100644 index 00000000..42be8ccc --- /dev/null +++ b/models/enterprise_sonic/ptp_default_ds/overridden_example_01.txt @@ -0,0 +1,34 @@ +# Using overridden +# +# Before State: +# ------------- +# +# sonic# show running-configuration ptp +# ptp mode boundary-clock +# ptp network-transport l2 multicast +# ptp domain 35 +# ptp domain-profile g8275.1 +# ptp priority2 100 +# ptp log-announce-interval -3 +# ptp announce-timeout 5 +# ptp log-sync-interval -4 +# ptp log-min-delay-req-interval -4 +# sonic# + +- name: Override device configuration of ptp with provided configuration + dellemc.enterprise_sonic.sonic_ptp: + config: + domain-number: 44 + domain-profile: 'G.8275.2' + network-transport: 'ipv4' + unicast-multicast: 'unicast' + state: overridden + +# After State: +# ------------ +# +# sonic# show running-configuration ptp +# ptp network-transport ipv4 unicast +# ptp domain 44 +# ptp domain-profile g8275.2 +# sonic# diff --git a/models/enterprise_sonic/ptp_default_ds/replaced_example_01.txt b/models/enterprise_sonic/ptp_default_ds/replaced_example_01.txt new file mode 100644 index 00000000..c18aeacb --- /dev/null +++ b/models/enterprise_sonic/ptp_default_ds/replaced_example_01.txt @@ -0,0 +1,39 @@ +# Using replaced +# +# Before State: +# ------------- +# +# sonic# show running-configuration ptp +# ptp network-transport ipv4 unicast +# ptp domain 44 +# ptp domain-profile default +# ptp priority1 100 +# ptp priority2 90 +# ptp log-announce-interval -2 +# ptp log-sync-interval -4 +# sonic# + +- name: Replace global PTP configurations + dellemc.enterprise_sonic.sonic_ptp: + config: + log-sync-interval: -3 + log-announce-interval: 1 + network-transport: 'L2' + unicast-multicast: 'multicast' + priority1 101 + priority2 91 + domain-number: 25 + state: replaced + +# After State: +# ------------ +# +# sonic# show running-configuration ptp +# ptp network-transport l2 multicast +# ptp domain 25 +# ptp domain-profile default +# ptp priority1 101 +# ptp priority2 91 +# ptp log-announce-interval 1 +# ptp log-sync-interval -3 +# sonic# diff --git a/models/enterprise_sonic/ptp_default_ds/sonic_ptp_default_ds.yml b/models/enterprise_sonic/ptp_default_ds/sonic_ptp_default_ds.yml new file mode 100644 index 00000000..7beb8b48 --- /dev/null +++ b/models/enterprise_sonic/ptp_default_ds/sonic_ptp_default_ds.yml @@ -0,0 +1,115 @@ +--- +GENERATOR_VERSION: '1.0' +ANSIBLE_METADATA: | + { + 'metadata_version': '1.1', + 'status': ['preview'], + 'supported_by': 'community', + 'license': 'Apache 2.0' + } +NETWORK_OS: sonic +RESOURCE: ptp_default_ds +COPYRIGHT: Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved +DOCUMENTATION: | + module: sonic_ptp_default_ds + version_added: '3.1.0' + short_description: Manage global PTP configurations on SONiC + description: + - This module provides configuration management of global PTP + parameters for devices running SONiC. + - The device should have timing chip support. + author: 'Vidya Chidambaram (@vidyac86)' + options: + config: + description: + - Specifies global PTP clock configurations. + type: dict + suboptions: + priority1: + description: + - The priority1 attribute of the local clock. + - The range is from 0 to 255. + type: int + priority2: + description: + - The priority2 attribute of the local clock. + - The range is from 0 to 255. + type: int + domain_number: + description: + - The domain number of the current syntonization domain. + - The range is from 0 to 127. + type: int + log_announce_interval: + description: + - The base-2 logarithm of the mean announceInterval (mean time + interval between successive Announce messages). + type: int + announce_receipt_timeout: + description: + - The number of announceIntervals that have to pass + without receipt of an Announce message before the + occurrence of the event ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES. + type: int + log_sync_interval: + description: + - The base-2 logarithm of the mean SyncInterval for multicast messages. + type: int + log_min_delay_req_interval: + description: + - The base-2 logarithm of the minDelayReqInterval. + - The minimum permitted mean time interval between successive Delay_Req messages. + type: int + two_step_flag: + description: + - The clockAccuracy indicates the expected accuracy of the clock. + type: int + clock_type: + description: + - Specifies the type of clock configured in the PTP domain. + type: str + choices: ['BC', 'E2E_TC', 'P2P_TC', 'disable'] + network_transport: + description: + - The network transport used for communication. + type: str + choices: ['L2', 'UDPv4', 'UDPv6'] + unicast_multicast: + description: + - Specifies whether the network transport uses unicast or multicast communication. + type: str + choices: ['unicast', 'multicast'] + domain_profile: + description: + - The method to be used when comparing data sets during the Best Master Clock Algorithm. + type: str + choices: ['ieee1588', 'G.8275.1', 'G.8275.2'] + source_interface: + description: + - Source interface whose IP to use as source ip for PTP IPv4 + and IPv6 multicast transport mode. + type: str + + state: + description: + - The state of the configuration after module completion. + - C(merged) - Merges provided PTP configuration with on-device + configuration. + - C(replaced) - Replaces on-device PTP configuration with provided + configuration. + - C(overridden) - Overrides all on-device PTP configurations with the + provided configuration. + - C(deleted) - Deletes on-device PTP configuration. + type: str + choices: + - merged + - deleted + - replaced + - overridden + default: merged +EXAMPLES: + - deleted_example_01.txt + - deleted_example_02.txt + - merged_example_01.txt + - replaced_example_01.txt + - overridden_example_01.txt diff --git a/models/enterprise_sonic/ptp_port_ds/deleted_example_01.txt b/models/enterprise_sonic/ptp_port_ds/deleted_example_01.txt new file mode 100644 index 00000000..fe09aebf --- /dev/null +++ b/models/enterprise_sonic/ptp_port_ds/deleted_example_01.txt @@ -0,0 +1,26 @@ +# Using deleted +# +# Before State: +# ------------- +# +# sonic# show running-configuration ptp | grep "ptp port" +# ptp port add Ethernet0 role slave local-priority 100 +# ptp port add Ethernet4 role master local-priority 90 +# ptp port master-table Ethernet0 add 1.1.1.1 +# sonic# + +- name: Delete specified PTP configurations + dellemc.enterprise_sonic.sonic_ptp_port_ds: + config: + - interface: 'Ethernet4' + role: 'master' + localpriority: 90 + state: deleted + +# After State: +# ------------ +# +# sonic# show running-configuration ptp +# ptp port add Ethernet0 role slave local-priority 100 +# ptp port master-table Ethernet0 add 1.1.1.1 +# sonic# diff --git a/models/enterprise_sonic/ptp_port_ds/deleted_example_02.txt b/models/enterprise_sonic/ptp_port_ds/deleted_example_02.txt new file mode 100644 index 00000000..44b9d327 --- /dev/null +++ b/models/enterprise_sonic/ptp_port_ds/deleted_example_02.txt @@ -0,0 +1,29 @@ +# Using deleted +# +# Before State: +# ------------- +# +# sonic# show running-configuration ptp | grep "ptp port" +# ptp port add Ethernet0 role slave local-priority 100 +# ptp port add Ethernet4 role master local-priority 90 +# ptp port master-table Ethernet0 add 1.1.1.1 +# ptp port master-table Ethernet0 add 1.1.1.2 +# sonic# + +- name: Delete specified PTP configurations + dellemc.enterprise_sonic.sonic_ptp_port_ds: + config: + - interface: 'Ethernet0' + role: 'slave' + localpriority: 100 + unicasttable: + - '1.1.1.1' + - '1.1.1.2' + state: deleted + +# After State: +# ------------ +# +# sonic# show running-configuration ptp +# ptp port add Ethernet4 role master local-priority 90 +# sonic# diff --git a/models/enterprise_sonic/ptp_port_ds/merged_example_01.txt b/models/enterprise_sonic/ptp_port_ds/merged_example_01.txt new file mode 100644 index 00000000..52c62e33 --- /dev/null +++ b/models/enterprise_sonic/ptp_port_ds/merged_example_01.txt @@ -0,0 +1,23 @@ +# Using merged +# +# Before State: +# ------------- +# +# sonic# show running-configuration ptp | grep "ptp port" +# ptp port add Ethernet0 +# sonic# + +- name: Merge provided global PTP configurations + dellemc.enterprise_sonic.sonic_ptp_port_ds: + config: + - interface: 'Ethernet0' + role: 'slave' + localpriority: 100 + state: merged + +# After State: +# ------------ +# +# sonic# show running-configuration ptp | grep "ptp port" +# ptp port add Ethernet0 role slave local-priority 100 +# sonic# diff --git a/models/enterprise_sonic/ptp_port_ds/overridden_example_01.txt b/models/enterprise_sonic/ptp_port_ds/overridden_example_01.txt new file mode 100644 index 00000000..333595db --- /dev/null +++ b/models/enterprise_sonic/ptp_port_ds/overridden_example_01.txt @@ -0,0 +1,24 @@ +# Using overridden +# +# Before State: +# ------------- +# +# sonic# show running-configuration ptp | grep "ptp port" +# ptp port add Ethernet0 role slave local-priority 100 +# ptp port master-table Ethernet0 add 1.1.1.1 +# sonic# + +- name: Override device configuration of PTP with provided configuration + dellemc.enterprise_sonic.sonic_ptp_port_ds: + config: + - interface: 'Ethernet4' + role: 'master' + localpriority: 90 + state: overridden + +# After State: +# ------------ +# +# sonic# show running-configuration ptp | grep "ptp port" +# ptp port add Ethernet4 role master local-priority 90 +# sonic# diff --git a/models/enterprise_sonic/ptp_port_ds/replaced_example_01.txt b/models/enterprise_sonic/ptp_port_ds/replaced_example_01.txt new file mode 100644 index 00000000..8c69a77d --- /dev/null +++ b/models/enterprise_sonic/ptp_port_ds/replaced_example_01.txt @@ -0,0 +1,31 @@ +# Using replaced +# +# Before State: +# ------------- +# +# sonic# do show running-configuration | grep "ptp port" +# ptp port add Ethernet0 role master local-priority 10 +# ptp port add Ethernet1 local-priority 100 +# ptp port add Ethernet2 role slave +# ptp port master-table Ethernet1 add 1.1.1.1 +# sonic# + +- name: Replace PTP configurations for specified port + dellemc.enterprise_sonic.sonic_ptp_port_ds: + config: + - interface : 'Ethernet0' + role: 'slave' + unicasttable: + - '2.2.2.2' + state: replaced + +# After State: +# ------------ +# +# sonic# do show running-configuration | grep "ptp port" +# ptp port add Ethernet0 role slave +# ptp port add Ethernet1 local-priority 100 +# ptp port add Ethernet2 role slave +# ptp port master-table Ethernet0 add 2.2.2.2 +# ptp port master-table Ethernet1 add 1.1.1.1 +# sonic# diff --git a/models/enterprise_sonic/ptp_port_ds/sonic_ptp_port_ds.yml b/models/enterprise_sonic/ptp_port_ds/sonic_ptp_port_ds.yml new file mode 100644 index 00000000..28a4e7e3 --- /dev/null +++ b/models/enterprise_sonic/ptp_port_ds/sonic_ptp_port_ds.yml @@ -0,0 +1,68 @@ +--- +GENERATOR_VERSION: '1.0' +ANSIBLE_METADATA: | + { + 'metadata_version': '1.1', + 'status': ['preview'], + 'supported_by': 'community', + 'license': 'Apache 2.0' + } +NETWORK_OS: sonic +RESOURCE: ptp_port_ds +COPYRIGHT: Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved +DOCUMENTATION: | + module: sonic_ptp_port_ds + version_added: '3.1.0' + short_description: Manage port specific PTP configurations on SONiC + description: + - This module provides configuration management of port-specific + PTP parameters for devices running SONiC. + author: 'Vidya Chidambaram (@vidyac86)' + options: + config: + description: + - Specifies port-specific PTP configurations. + type: list + elements: dict + suboptions: + interface: + description: + - Specifies the name of the interface. + required: true + type: str + role: + description: + - Specifies the role of interface. + type: str + choices: ['DYNAMIC', 'MASTER', 'SLAVE'] + localpriority: + description: + - Specifies the local-priority attribute used for the profile G8275-1 and G8275-2. + - The range is from 1 to 255. + type: int + default: + unicasttable: + description: + - The comma-separated list of ip addresses to use for master. + type: list + elements: str + state: + description: + - The state of the configuration after module completion. + - C(merged) - Merges provided interface-specific PTP configuration with on-device configuration. + - C(replaced) - Replaces on-device PTP configuration of the specified interfaces with provided configuration. + - C(overridden) - Overrides all on-device interface-specific PTP configurations with the provided configuration. + - C(deleted) - Deletes on-device interface-specific PTP configuration. + type: str + choices: + - merged + - deleted + - replaced + - overridden + default: merged +EXAMPLES: + - deleted_example_01.txt + - deleted_example_02.txt + - merged_example_01.txt + - replaced_example_01.txt + - overridden_example_01.txt