�
�Udac @ s� i d d 6d g d 6d d 6Z d Z d Z d Z d d
l Z d d l m Z m Z m Z d d l m Z m
Z
d d
l m Z d � Z
d � Z e d k r� e � n d
S( s 1.1t metadata_versiont previewt statust networkt supported_bys�
---
module: nxos_ntp_options
extends_documentation_fragment: nxos
version_added: "2.2"
short_description: Manages NTP options.
description:
- Manages NTP options, e.g. authoritative server and logging.
author:
- Jason Edelman (@jedelman8)
notes:
- Tested against NXOSv 7.3.(0)D1(1) on VIRL
- When C(state=absent), master and logging will be set to False and
stratum will be removed as well
options:
master:
description:
- Sets whether the device is an authoritative NTP server.
type: bool
stratum:
description:
- If C(master=true), an optional stratum can be supplied (1-15).
The device default is 8.
logging:
description:
- Sets whether NTP logging is enabled on the device.
type: bool
state:
description:
- Manage the state of the resource.
default: present
choices: ['present','absent']
s�
# Basic NTP options configuration
- nxos_ntp_options:
master: true
stratum: 12
logging: false
host: "{{ inventory_hostname }}"
username: "{{ un }}"
password: "{{ pwd }}"
s�
updates:
description: command sent to the device
returned: always
type: list
sample: ["no ntp logging", "ntp master 12"]
i����N( t
get_configt load_configt run_commands( t nxos_argument_spect
check_args( t
AnsibleModulec C s� d } t } t } d } t | i | d 6d d 6� d } | r� t j d | t j � } | ru t } | j d � } n d | j � k } n i | d 6| d
6| d 6S( Ns show running-config | inc ntpt commandt textt outputi s ^ntp master(?: (\d+))i s ntp loggingt mastert stratumt logging( t Falset NoneR t ret searcht Mt Truet groupt lower( t modulet cmdR R R R
t match( ( sQ /usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_ntp_options.pyt get_currentS s !c
C s� t d t d t d d � d t d t d d � d t d t d d � d t d d
d g d d � � } | j t � t d
| d t � } t � } t | | � | j d } | j d } | j d } | j d } | r| t k r| d k r| j d d � qn t
| � } i t d 6} t � } | d
k rh| d rK| j d � n | d r/| j d � q/n� | d k r/| r�| d r�| j d � n&