2019-02-01 15:20:02 +01:00
|
|
|
---
|
|
|
|
- name: remove NTP (if set)
|
2019-05-27 16:21:08 +02:00
|
|
|
ios_ntp: &remove
|
2019-02-01 15:20:02 +01:00
|
|
|
server: 10.75.32.5
|
2019-05-27 19:11:58 +02:00
|
|
|
source_int: "{{ test_interface }}"
|
2019-02-01 15:20:02 +01:00
|
|
|
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
|
2019-05-27 19:11:58 +02:00
|
|
|
source_int: "{{ test_interface }}"
|
2019-02-01 15:20:02 +01:00
|
|
|
state: present
|
2019-05-27 19:11:58 +02:00
|
|
|
register: result
|
2019-02-01 15:20:02 +01:00
|
|
|
|
|
|
|
- assert: &true
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: idempotence check
|
|
|
|
ios_ntp: *config
|
2019-05-27 19:11:58 +02:00
|
|
|
register: result
|
2019-02-01 15:20:02 +01:00
|
|
|
|
|
|
|
- assert: &false
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
|
|
|
- name: configure NTP
|
|
|
|
ios_ntp: &config1
|
|
|
|
acl: NTP_ACL
|
|
|
|
logging: true
|
|
|
|
state: present
|
2019-05-27 19:11:58 +02:00
|
|
|
register: result
|
2019-02-01 15:20:02 +01:00
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: idempotence check
|
|
|
|
ios_ntp: *config1
|
2019-05-27 19:11:58 +02:00
|
|
|
register: result
|
2019-02-01 15:20:02 +01:00
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
- name: configure NTP with diffferen values
|
|
|
|
ios_ntp: &config2
|
|
|
|
key_id: 10
|
|
|
|
auth_key: 15435A030726242723273C21181319000A
|
|
|
|
auth: true
|
|
|
|
state: present
|
2019-05-27 19:11:58 +02:00
|
|
|
register: result
|
2019-02-01 15:20:02 +01:00
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: idempotence check
|
|
|
|
ios_ntp: *config2
|
2019-05-27 19:11:58 +02:00
|
|
|
register: result
|
2019-02-01 15:20:02 +01:00
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
- name: remove part of config
|
|
|
|
ios_ntp: &config3
|
|
|
|
acl: NTP_ACL
|
|
|
|
logging: true
|
|
|
|
state: absent
|
2019-05-27 19:11:58 +02:00
|
|
|
register: result
|
2019-02-01 15:20:02 +01:00
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: idempotence check
|
|
|
|
ios_ntp: *config3
|
2019-05-27 19:11:58 +02:00
|
|
|
register: result
|
2019-02-01 15:20:02 +01:00
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
always:
|
|
|
|
- name: Remove ntp config
|
|
|
|
ios_ntp: *remove
|