Manages NTP on network devices.
codeauthor: | Mircea Ulinic <mircea@cloudflare.com> & Jerome Fleury <jf@cloudflare.com> |
---|---|
maturity: | new |
depends: | napalm |
platform: | unix |
See also
New in version 2016.11.0.
Removes NTP peers configured on the device.
Parameters: |
|
---|
By default this function will commit the config changes (if any). To load without committing, use the commit
option. For a dry run, use the test
argument.
CLI Example:
salt '*' ntp.delete_peers 8.8.8.8 time.apple.com salt '*' ntp.delete_peers 172.17.17.1 test=True # only displays the diff salt '*' ntp.delete_peers 192.168.0.1 commit=False # preserves the changes, but does not commit
Removes NTP servers configured on the device.
Parameters: |
|
---|
By default this function will commit the config changes (if any). To load without committing, use the commit
option. For dry run use the test
argument.
CLI Example:
salt '*' ntp.delete_servers 8.8.8.8 time.apple.com salt '*' ntp.delete_servers 172.17.17.1 test=True # only displays the diff salt '*' ntp.delete_servers 192.168.0.1 commit=False # preserves the changes, but does not commit
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' ]
Returns a list of the configured NTP servers on the device.
CLI Example:
salt '*' ntp.servers
Example output:
[ '192.168.0.1', '172.17.17.1', '172.17.17.2', '2400:cb00:6:1024::c71b:840a' ]
Configures a list of NTP peers on the device.
Parameters: |
|
---|---|
Commit commit (bool): | |
commit loaded config. By default |
By default this function will commit the config changes (if any). To load without committing, use the commit option. For dry run use the test argument.
CLI Example:
salt '*' ntp.set_peers 192.168.0.1 172.17.17.1 time.apple.com salt '*' ntp.set_peers 172.17.17.1 test=True # only displays the diff salt '*' ntp.set_peers 192.168.0.1 commit=False # preserves the changes, but does not commit
Configures a list of NTP servers on the device.
Parameters: |
|
---|---|
Commit commit (bool): | |
commit loaded config. By default |
By default this function will commit the config changes (if any). To load without committing, use the commit option. For dry run use the test argument.
CLI Example:
salt '*' ntp.set_servers 192.168.0.1 172.17.17.1 time.apple.com salt '*' ntp.set_servers 172.17.17.1 test=True # only displays the diff salt '*' ntp.set_servers 192.168.0.1 commit=False # preserves the changes, but does not commit
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:
|
CLI Example:
salt '*' ntp.stats
Example output:
[ { 'remote' : '188.114.101.4', 'referenceid' : '188.114.100.1', 'synchronized' : True, 'stratum' : 4, 'type' : '-', 'when' : '107', 'hostpoll' : 256, 'reachability' : 377, 'delay' : 164.228, 'offset' : -13.866, 'jitter' : 2.695 } ]
© 2019 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.napalm_ntp.html