dellemc.enterprise_sonic.sonic_ptp_port_ds module – Manage port specific PTP configurations on SONiC
Note
This module is part of the dellemc.enterprise_sonic collection (version 3.2.0).
You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install dellemc.enterprise_sonic.
To use it in a playbook, specify: dellemc.enterprise_sonic.sonic_ptp_port_ds.
New in dellemc.enterprise_sonic 3.1.0
Synopsis
- This module provides configuration management of port-specific PTP parameters for devices running SONiC.
Parameters
Parameter | Comments |
|---|---|
config list / elements=dictionary | Specifies port-specific PTP configurations. |
|
interface string / required |
Specifies the name of the interface. |
|
local_priority integer |
Specifies the local-priority attribute used for the profile G8275-1 and G8275-2. The range is from 1 to 255. |
|
role string |
Specifies the role of interface. Choices:
|
|
unicast_table list / elements=string |
List of ip addresses to use for PTP master. |
state string | The state of the configuration after module completion.
Choices:
|
Notes
Note
- Supports
check_mode.
Examples
# 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 port configurations
dellemc.enterprise_sonic.sonic_ptp_port_ds:
config:
- interface: 'Ethernet4'
role: 'master'
local_priority: 90
- interface: 'Ethernet0'
role: 'slave'
local_priority: 100
unicast_table:
- '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#
# 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 all PTP configurations in the specified port
dellemc.enterprise_sonic.sonic_ptp_port_ds:
config:
- interface: 'Ethernet0'
state: deleted
# After State:
# ------------
#
# sonic# show running-configuration ptp
# ptp port add Ethernet4 role master local-priority 90
# sonic#
# 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 all PTP port configurations
dellemc.enterprise_sonic.sonic_ptp_port_ds:
config:
state: deleted
# After State:
# ------------
#
# sonic# show running-configuration ptp
# sonic#
# Using merged
#
# Before State:
# -------------
#
# sonic# show running-configuration ptp | grep "ptp port"
# ptp port add Ethernet0
# sonic#
- name: Merge provided PTP port configurations
dellemc.enterprise_sonic.sonic_ptp_port_ds:
config:
- interface: 'Ethernet0'
role: 'slave'
local_priority: 100
state: merged
# After State:
# ------------
#
# sonic# show running-configuration ptp | grep "ptp port"
# ptp port add Ethernet0 role slave local-priority 100
# sonic#
# 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'
unicast_table:
- '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#
# 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 PTP port configuration with provided configuration
dellemc.enterprise_sonic.sonic_ptp_port_ds:
config:
- interface: 'Ethernet4'
role: 'master'
local_priority: 90
state: overridden
# After State:
# ------------
#
# sonic# show running-configuration ptp | grep "ptp port"
# ptp port add Ethernet4 role master local-priority 90
# sonic#
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
after dictionary | The resulting configuration model invocation. Returned: when changed Sample: |
after(generated) list / elements=string | The generated configuration on module invocation. Returned: when Sample: |
before dictionary | The configuration prior to the model invocation. Returned: always Sample: |
commands list / elements=string | The set of commands pushed to the remote device. Returned: always Sample: |
Collection links
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/projects/ansible/latest/collections/dellemc/enterprise_sonic/sonic_ptp_port_ds_module.html