|
|
|
@ -180,11 +180,15 @@ def get_ntp_source(module):
|
|
|
|
|
def get_ntp_peer(module):
|
|
|
|
|
command = 'show run | inc ntp.(server|peer)'
|
|
|
|
|
ntp_peer_list = []
|
|
|
|
|
ntp = execute_show_command(
|
|
|
|
|
response = execute_show_command(
|
|
|
|
|
command, module, command_type='cli_show_ascii')
|
|
|
|
|
if ntp:
|
|
|
|
|
ntp = ntp[0]
|
|
|
|
|
|
|
|
|
|
if response:
|
|
|
|
|
if isinstance(response, list):
|
|
|
|
|
ntp = response[0]
|
|
|
|
|
else:
|
|
|
|
|
ntp = response
|
|
|
|
|
if ntp:
|
|
|
|
|
ntp_regex = (
|
|
|
|
|
".*ntp\s(server\s(?P<address>\S+)|peer\s(?P<peer_address>\S+))"
|
|
|
|
|
"\s*((?P<prefer>prefer)\s*)?(use-vrf\s(?P<vrf_name>\S+)\s*)?"
|
|
|
|
@ -424,4 +428,3 @@ def main():
|
|
|
|
|
from ansible.module_utils.basic import *
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
main()
|
|
|
|
|
|
|
|
|
|