salt.modules.napalm_ntp module

NAPALM NTP

Manages NTP peers of a network device.

codeauthor:Mircea Ulinic <mircea@cloudflare.com> & Jerome Fleury <jf@cloudflare.com>
maturity:new
depends:napalm
platform:linux

See also

salt.modules.napalm_ntp.delete_peers(*peers)

Removes NTP peers configured on the device.

Parameters:peers -- list of IP Addresses/Domain Names to be removed as NTP peers

CLI Example:

salt '*' ntp.delete_peers 8.8.8.8 time.apple.com
salt.modules.napalm_ntp.peers()

Returns a list the NTP peers configured on the network device.

Returns:configured NTP peers as list.

CLI Example:

salt '*' ntp.peers

Example output:

[
    '192.168.0.1',
    '172.17.17.1',
    '172.17.17.2',
    '2400:cb00:6:1024::c71b:840a'
]
salt.modules.napalm_ntp.set_peers(*peers)

Configures a list of NTP peers on the device.

Parameters:peers -- list of IP Addresses/Domain Names

CLI Example:

salt '*' ntp.set_peers 192.168.0.1 172.17.17.1 time.apple.com
salt.modules.napalm_ntp.stats(peer='')

Returns a dictionary containing synchronization details of the NTP peers.

Parameters:peer -- Returns only the details of a specific NTP peer.
Returns:a list of dictionaries, with the following keys:
  • remote
  • referenceid
  • synchronized
  • stratum
  • type
  • when
  • hostpoll
  • reachability
  • delay
  • offset
  • jitter

CLI Example:

salt '*' ntp.stats

Example output:

[
    {
        'remote'        : u'188.114.101.4',
        'referenceid'   : u'188.114.100.1',
        'synchronized'  : True,
        'stratum'       : 4,
        'type'          : u'-',
        'when'          : u'107',
        'hostpoll'      : 256,
        'reachability'  : 377,
        'delay'         : 164.228,
        'offset'        : -13.866,
        'jitter'        : 2.695
    }
]