1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/ios_ntp/tests/cli/ntp_configuration.yaml
Sumit Jaiswal 04bfcd08a8 PR to fix the IOS_NTP integration TC failure (#57481)
* ios_ntp tc fail

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* ios_ntp tc fail

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* fix for local connection

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
2019-06-07 11:56:30 -04:00

107 lines
2 KiB
YAML

---
- debug: msg="START connection={{ ansible_connection }} ios_ntp sanity test"
- name: remove NTP (if set)
ios_ntp: &remove
server: 10.75.32.5
source_int: "{{ test_interface }}"
acl: NTP_ACL
logging: true
key_id: 10
auth_key: 15435A030726242723273C21181319000A
auth: true
state: absent
provider: "{{ cli }}"
ignore_errors: true
- block:
- name: configure NTP
ios_ntp: &config
server: 10.75.32.5
source_int: "{{ test_interface }}"
state: present
provider: "{{ cli }}"
register: result
- assert: &true
that:
- "result.changed == true"
- name: idempotence check
ios_ntp: *config
register: result
- assert: &false
that:
- "result.changed == false"
- name: load acl NTP_ACL into device
ios_config:
lines:
- 10 permit ip host 192.0.2.1 any log
parents: ip access-list extended NTP_ACL
provider: "{{ cli }}"
register: result
- assert: *true
- name: configure NTP
ios_ntp: &config1
acl: NTP_ACL
logging: true
state: present
provider: "{{ cli }}"
register: result
- assert: *true
- name: idempotence check
ios_ntp: *config1
register: result
- assert: *false
- name: configure NTP with diffferen values
ios_ntp: &config2
key_id: 10
auth_key: 15435A030726242723273C21181319000A
auth: true
state: present
provider: "{{ cli }}"
register: result
- assert: *true
- name: idempotence check
ios_ntp: *config2
register: result
- assert: *false
- name: remove part of config
ios_ntp: &config3
acl: NTP_ACL
logging: true
state: absent
provider: "{{ cli }}"
register: result
- assert: *true
- name: idempotence check
ios_ntp: *config3
register: result
- assert: *false
always:
- name: Remove ntp config
ios_ntp: *remove
- name: remove NTP_ACL from device
ios_config:
lines:
- no ip access-list extended NTP_ACL
provider: "{{ cli }}"