�
�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 d d l m Z m Z d d
l m
Z
m Z d � Z d � Z
d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z e d k r� e � n d
S( s 1.1t metadata_versiont previewt statust networkt supported_bys
---
module: ios_ntp
extends_documentation_fragment: ios
version_added: "2.8"
short_description: Manages core NTP configuration.
description:
- Manages core NTP configuration.
author:
- Federico Olivieri (@Federico87)
options:
server:
description:
- Network address of NTP server.
source_int:
description:
- Source interface for NTP packets.
acl:
description:
- ACL for peer/server access restricition.
logging:
description:
- Enable NTP logs. Data type boolean.
type: bool
default: False
auth:
description:
- Enable NTP authentication. Data type boolean.
type: bool
default: False
auth_key:
description:
- md5 NTP authentication key of type 7.
key_id:
description:
- auth_key id. Data type string
state:
description:
- Manage the state of the resource.
default: present
choices: ['present', 'absent']
sR
# Set new NTP server and source interface
- ios_ntp:
server: 10.0.255.10
source_int: Loopback0
logging: false
state: present
# Remove NTP ACL and logging
- ios_ntp:
acl: NTP_ACL
logging: true
state: absent
# Set NTP authentication
- ios_ntp:
key_id: 10
auth_key: 15435A030726242723273C21181319000A
auth: true
state: present
# Set new NTP configuration
- ios_ntp:
server: 10.0.255.10
source_int: Loopback0
acl: NTP_ACL
logging: true
key_id: 10
auth_key: 15435A030726242723273C21181319000A
auth: true
state: present
s�
commands:
description: command sent to the device
returned: always
type: list
sample: ["no ntp server 10.0.255.10", "no ntp source Loopback0"]
i����N( t
AnsibleModule( t
get_configt load_config( t ios_argument_spect
check_argsc C sD | d k r@ t j d | t j � } | r@ | j d � } | Sn d S( Nt servers! (ntp server )(\d+\.\d+\.\d+\.\d+)i ( t ret searcht Mt group( t linet destt matchR
( ( sG /usr/lib/python2.7/site-packages/ansible/modules/network/ios/ios_ntp.pyt parse_serverc s
c C sD | d k r@ t j d | t j � } | r@ | j d � } | Sn d S( Nt sources (ntp source )(\S+)i ( R R R
R ( R R R R ( ( sG /usr/lib/python2.7/site-packages/ansible/modules/network/ios/ios_ntp.pyt parse_source_intk s
c C sD | d k r@ t j d | t j � } | r@ | j d � } | Sn d S( Ns access-groups+ ntp access-group (?:peer|serve)(?:\s+)(\S+)i ( R R R
R ( R R R t acl( ( sG /usr/lib/python2.7/site-packages/ansible/modules/network/ios/ios_ntp.pyt parse_acls s
c C s | d k r | } | Sd S( Nt logging( ( R R R ( ( sG /usr/lib/python2.7/site-packages/ansible/modules/network/ios/ios_ntp.pyt
parse_logging{ s c C sD | d k r@ t j d | t j � } | r@ | j d � } | Sn d S( Ns authentication-keys&