�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
m Z d d l m
Z
d d
l m Z d e f d � � YZ d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bys!
---
module: onyx_ptp_global
version_added: "2.8"
author: "Anas Badaha (@anasb)"
short_description: Configures PTP Global parameters
description:
- This module provides declarative management of PTP Global configuration
on Mellanox ONYX network devices.
notes:
- Tested on ONYX 3.6.8130
ptp and ntp protocols cannot be enabled at the same time
options:
ptp_state:
description:
- PTP state.
choices: ['enabled', 'disabled']
default: enabled
ntp_state:
description:
- NTP state.
choices: ['enabled', 'disabled']
domain:
description:
- "set PTP domain number Range 0-127"
primary_priority:
description:
- "set PTP primary priority Range 0-225"
secondary_priority:
description:
- "set PTP secondary priority Range 0-225"
s�
- name: configure PTP
onyx_ptp_global:
ntp_state: enabled
ptp_state: disabled
domain: 127
primary_priority: 128
secondary_priority: 128
s�
commands:
description: The list of configuration mode commands to send to the device.
returned: always
type: list
sample:
- no ntp enable
- protocol ptp
- ptp domain 127
( t
AnsibleModule( t show_cmd( t BaseOnyxModulet OnyxPtpGlobalModulec B` s� e Z d � Z d � Z d d � Z d � Z d � Z d � Z d � Z d � Z
d � Z d � Z d
� Z
d � Z d � Z d
� Z d � Z d � Z RS( c
C` s� t d t d d d g � d t d d d g d d � d t d t � d t d t � d
t d t � � } t � } | j | � t d | d t � | _ d
S( s initialize module
t ntp_statet choicest enabledt disabledt ptp_statet defaultt domaint typet primary_priorityt secondary_priorityt
argument_spect supports_check_modeN( t dictt intt updateR t Truet _module( t selft element_specR ( ( sP /usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_ptp_global.pyt init_moduleJ s
c C` s/ | j j } t | � | _ | j | j � d S( N( R t paramsR t _required_configt _validate_param_values( R t
module_params( ( sP /usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_ptp_global.pyt get_required_configZ s c C` sS t t | � j | | � | d d k rO | d d k rO | j j d d � n d S( NR R R t msgs; PTP State and NTP State Can not be enabled at the same time( t superR t validate_param_valuesR t fail_json( R t objt param( ( sP /usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_ptp_global.pyR"