ios_ntp module (#50705)

* ios_ntp module

* add execute_module for config func

* fix units test

* test empty list

* update example

* change want logic to follow have - removed try/except

* update commands list for config test

* add idempotent test case

* add more test
This commit is contained in:
Federico87
2019-02-01 14:20:02 +00:00
committed by Nathaniel Case
parent 004d8b03d4
commit f94378fc2f
8 changed files with 518 additions and 0 deletions

View File

@@ -0,0 +1,75 @@
---
- name: remove NTP (if set)
ios_ntp:
server: 10.75.32.5
source_int: Loopback0
acl: NTP_ACL
logging: true
key_id: 10
auth_key: 15435A030726242723273C21181319000A
auth: true
state: absent
ignore_errors: true
- block:
- name: configure NTP
ios_ntp: &config
server: 10.75.32.5
source_int: Loopback0
state: present
- assert: &true
that:
- "result.changed == true"
- name: idempotence check
ios_ntp: *config
- assert: &false
that:
- "result.changed == false"
- name: configure NTP
ios_ntp: &config1
acl: NTP_ACL
logging: true
state: present
- assert: *true
- name: idempotence check
ios_ntp: *config1
- assert: *false
- name: configure NTP with diffferen values
ios_ntp: &config2
key_id: 10
auth_key: 15435A030726242723273C21181319000A
auth: true
state: present
- assert: *true
- name: idempotence check
ios_ntp: *config2
- assert: *false
- name: remove part of config
ios_ntp: &config3
acl: NTP_ACL
logging: true
state: absent
- assert: *true
- name: idempotence check
ios_ntp: *config3
- assert: *false
always:
- name: Remove ntp config
ios_ntp: *remove